]>
Commit | Line | Data |
---|---|---|
0086e2c8 | 1 | git-lost-found(1) |
04e7ca1a JH |
2 | ================= |
3 | ||
4 | NAME | |
5 | ---- | |
0086e2c8 | 6 | git-lost-found - Recover lost refs that luckily have not yet been pruned. |
04e7ca1a JH |
7 | |
8 | SYNOPSIS | |
9 | -------- | |
0086e2c8 | 10 | 'git-lost-found' |
04e7ca1a JH |
11 | |
12 | DESCRIPTION | |
13 | ----------- | |
14 | Finds dangling commits and tags from the object database, and | |
07203659 JH |
15 | creates refs to them in .git/lost-found/ directory. Commits and |
16 | tags that dereference to commits go to .git/lost-found/commit | |
17 | and others are stored in .git/lost-found/other directory. | |
04e7ca1a JH |
18 | |
19 | ||
20 | OUTPUT | |
21 | ------ | |
22 | One line description from the commit and tag found along with | |
23 | their object name are printed on the standard output. | |
24 | ||
25 | ||
26 | EXAMPLE | |
27 | ------- | |
28 | ||
29 | Suppose you run 'git tag -f' and mistyped the tag to overwrite. | |
30 | The ref to your tag is overwritten, but until you run 'git | |
31 | prune', it is still there. | |
32 | ||
33 | ------------ | |
0086e2c8 | 34 | $ git lost-found |
04e7ca1a JH |
35 | [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c |
36 | ... | |
37 | ------------ | |
38 | ||
39 | Also you can use gitk to browse how they relate to each other | |
40 | and existing (probably old) tags. | |
41 | ||
42 | ------------ | |
07203659 | 43 | $ gitk $(cd .git/lost-found/commit && echo ??*) |
04e7ca1a JH |
44 | ------------ |
45 | ||
46 | After making sure that it is the object you are looking for, you | |
47 | can reconnect it to your regular .git/refs hierarchy. | |
48 | ||
49 | ------------ | |
50 | $ git cat-file -t 1ef2b196 | |
51 | tag | |
52 | $ git cat-file tag 1ef2b196 | |
53 | object fa41bbce8e38c67a218415de6cfa510c7e50032a | |
54 | type commit | |
55 | tag v0.99.9c | |
56 | tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800 | |
57 | ||
58 | GIT 0.99.9c | |
59 | ||
60 | This contains the following changes from the "master" branch, since | |
61 | ... | |
62 | $ git update-ref refs/tags/not-lost-anymore 1ef2b196 | |
63 | $ git rev-parse not-lost-anymore | |
64 | 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6 | |
65 | ------------ | |
66 | ||
67 | Author | |
68 | ------ | |
e6bd2391 | 69 | Written by Junio C Hamano 濱野 純 <junkio@cox.net> |
04e7ca1a JH |
70 | |
71 | Documentation | |
72 | -------------- | |
73 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. | |
74 | ||
75 | ||
76 | GIT | |
77 | --- | |
78 | Part of the gitlink:git[7] suite |