blob: d54932889f3d5b3c59f403920203911d52227365 [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--------
Junio C Hamano15567bc2011-07-23 00:51:5910[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3811'git lost-found'
Junio C Hamano1a4e8412005-12-27 08:17:2312
13DESCRIPTION
14-----------
Junio C Hamano422cfec2007-11-08 08:07:4515
Junio C Hamano35738e82008-01-07 07:55:4616*NOTE*: this command is deprecated. Use linkgit:git-fsck[1] with
Junio C Hamano422cfec2007-11-08 08:07:4517the option '--lost-found' instead.
18
Junio C Hamano1a4e8412005-12-27 08:17:2319Finds dangling commits and tags from the object database, and
Junio C Hamano0e3cb532007-04-17 08:28:1120creates refs to them in the .git/lost-found/ directory. Commits and
21tags that dereference to commits are stored in .git/lost-found/commit,
22and other objects are stored in .git/lost-found/other.
Junio C Hamano1a4e8412005-12-27 08:17:2323
24
25OUTPUT
26------
Junio C Hamano0e3cb532007-04-17 08:28:1127Prints to standard output the object names and one-line descriptions
28of any commits or tags found.
Junio C Hamano1a4e8412005-12-27 08:17:2329
30EXAMPLE
31-------
32
Junio C Hamano0e3cb532007-04-17 08:28:1133Suppose you run 'git tag -f' and mistype the tag to overwrite.
Junio C Hamano1a4e8412005-12-27 08:17:2334The ref to your tag is overwritten, but until you run 'git
Junio C Hamano0e3cb532007-04-17 08:28:1135prune', the tag itself is still there.
Junio C Hamano1a4e8412005-12-27 08:17:2336
37------------
38$ git lost-found
39[1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
40...
41------------
42
Junio C Hamano0e3cb532007-04-17 08:28:1143Also you can use gitk to browse how any tags found relate to each
44other.
Junio C Hamano1a4e8412005-12-27 08:17:2345
46------------
47$ gitk $(cd .git/lost-found/commit && echo ??*)
48------------
49
Junio C Hamano0e3cb532007-04-17 08:28:1150After making sure you know which the object is the tag you are looking
Junio C Hamanod0316112012-08-22 19:55:2951for, you can reconnect it to your regular `refs` hierarchy by using
52the `update-ref` command.
Junio C Hamano1a4e8412005-12-27 08:17:2353
54------------
55$ git cat-file -t 1ef2b196
56tag
57$ git cat-file tag 1ef2b196
58object fa41bbce8e38c67a218415de6cfa510c7e50032a
59type commit
60tag v0.99.9c
61tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
62
63GIT 0.99.9c
64
65This contains the following changes from the "master" branch, since
66...
67$ git update-ref refs/tags/not-lost-anymore 1ef2b196
68$ git rev-parse not-lost-anymore
691ef2b196d909eed523d4f3c9bf54b78cdd6843c6
70------------
71
Junio C Hamano1a4e8412005-12-27 08:17:2372GIT
73---
Junio C Hamanof7c042d2008-06-06 22:50:5374Part of the linkgit:git[1] suite