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