blob: bc739117beaf0a3ca56c4158e40f8879d74018e3 [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-----------
14Finds dangling commits and tags from the object database, and
Junio C Hamano0e3cb532007-04-17 08:28:1115creates refs to them in the .git/lost-found/ directory. Commits and
16tags that dereference to commits are stored in .git/lost-found/commit,
17and other objects are stored in .git/lost-found/other.
Junio C Hamano1a4e8412005-12-27 08:17:2318
19
20OUTPUT
21------
Junio C Hamano0e3cb532007-04-17 08:28:1122Prints to standard output the object names and one-line descriptions
23of any commits or tags found.
Junio C Hamano1a4e8412005-12-27 08:17:2324
25EXAMPLE
26-------
27
Junio C Hamano0e3cb532007-04-17 08:28:1128Suppose you run 'git tag -f' and mistype the tag to overwrite.
Junio C Hamano1a4e8412005-12-27 08:17:2329The ref to your tag is overwritten, but until you run 'git
Junio C Hamano0e3cb532007-04-17 08:28:1130prune', the tag itself is still there.
Junio C Hamano1a4e8412005-12-27 08:17:2331
32------------
33$ git lost-found
34[1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
35...
36------------
37
Junio C Hamano0e3cb532007-04-17 08:28:1138Also you can use gitk to browse how any tags found relate to each
39other.
Junio C Hamano1a4e8412005-12-27 08:17:2340
41------------
42$ gitk $(cd .git/lost-found/commit && echo ??*)
43------------
44
Junio C Hamano0e3cb532007-04-17 08:28:1145After making sure you know which the object is the tag you are looking
46for, you can reconnect it to your regular .git/refs hierarchy.
Junio C Hamano1a4e8412005-12-27 08:17:2347
48------------
49$ git cat-file -t 1ef2b196
50tag
51$ git cat-file tag 1ef2b196
52object fa41bbce8e38c67a218415de6cfa510c7e50032a
53type commit
54tag v0.99.9c
55tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
56
57GIT 0.99.9c
58
59This contains the following changes from the "master" branch, since
60...
61$ git update-ref refs/tags/not-lost-anymore 1ef2b196
62$ git rev-parse not-lost-anymore
631ef2b196d909eed523d4f3c9bf54b78cdd6843c6
64------------
65
66Author
67------
Junio C Hamano9810d632007-09-24 01:05:3468Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:2369
70Documentation
71--------------
72Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
73
74
75GIT
76---
77Part of the gitlink:git[7] suite