blob: b1c797f1097b4d89eb2ef7eefd5726bc840428fc [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-lost-found(1)
2=================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-lost-found - Recover lost refs that luckily have not yet been pruned
Junio C Hamano1a4e8412005-12-27 08:17:237
8SYNOPSIS
9--------
10'git-lost-found'
11
12DESCRIPTION
13-----------
Junio C Hamano422cfec2007-11-08 08:07:4514
Junio C Hamano35738e82008-01-07 07:55:4615*NOTE*: this command is deprecated. Use linkgit:git-fsck[1] with
Junio C Hamano422cfec2007-11-08 08:07:4516the option '--lost-found' instead.
17
Junio C Hamano1a4e8412005-12-27 08:17:2318Finds dangling commits and tags from the object database, and
Junio C Hamano0e3cb532007-04-17 08:28:1119creates refs to them in the .git/lost-found/ directory. Commits and
20tags that dereference to commits are stored in .git/lost-found/commit,
21and other objects are stored in .git/lost-found/other.
Junio C Hamano1a4e8412005-12-27 08:17:2322
23
24OUTPUT
25------
Junio C Hamano0e3cb532007-04-17 08:28:1126Prints to standard output the object names and one-line descriptions
27of any commits or tags found.
Junio C Hamano1a4e8412005-12-27 08:17:2328
29EXAMPLE
30-------
31
Junio C Hamano0e3cb532007-04-17 08:28:1132Suppose you run 'git tag -f' and mistype the tag to overwrite.
Junio C Hamano1a4e8412005-12-27 08:17:2333The ref to your tag is overwritten, but until you run 'git
Junio C Hamano0e3cb532007-04-17 08:28:1134prune', the tag itself is still there.
Junio C Hamano1a4e8412005-12-27 08:17:2335
36------------
37$ git lost-found
38[1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
39...
40------------
41
Junio C Hamano0e3cb532007-04-17 08:28:1142Also you can use gitk to browse how any tags found relate to each
43other.
Junio C Hamano1a4e8412005-12-27 08:17:2344
45------------
46$ gitk $(cd .git/lost-found/commit && echo ??*)
47------------
48
Junio C Hamano0e3cb532007-04-17 08:28:1149After making sure you know which the object is the tag you are looking
50for, you can reconnect it to your regular .git/refs hierarchy.
Junio C Hamano1a4e8412005-12-27 08:17:2351
52------------
53$ git cat-file -t 1ef2b196
54tag
55$ git cat-file tag 1ef2b196
56object fa41bbce8e38c67a218415de6cfa510c7e50032a
57type commit
58tag v0.99.9c
59tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
60
61GIT 0.99.9c
62
63This 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
671ef2b196d909eed523d4f3c9bf54b78cdd6843c6
68------------
69
70Author
71------
Junio C Hamano9810d632007-09-24 01:05:3472Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:2373
74Documentation
75--------------
76Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
77
78
79GIT
80---
Junio C Hamano35738e82008-01-07 07:55:4681Part of the linkgit:git[7] suite