Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-lost-found(1) |
| 2 | ================= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 6 | git-lost-found - Recover lost refs that luckily have not yet been pruned |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 10 | [verse] |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 11 | 'git lost-found' |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
Junio C Hamano | 422cfec | 2007-11-08 08:07:45 | [diff] [blame] | 15 | |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 16 | *NOTE*: this command is deprecated. Use linkgit:git-fsck[1] with |
Junio C Hamano | 422cfec | 2007-11-08 08:07:45 | [diff] [blame] | 17 | the option '--lost-found' instead. |
| 18 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 19 | Finds dangling commits and tags from the object database, and |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 20 | creates refs to them in the .git/lost-found/ directory. Commits and |
| 21 | tags that dereference to commits are stored in .git/lost-found/commit, |
| 22 | and other objects are stored in .git/lost-found/other. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 23 | |
| 24 | |
| 25 | OUTPUT |
| 26 | ------ |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 27 | Prints to standard output the object names and one-line descriptions |
| 28 | of any commits or tags found. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 29 | |
| 30 | EXAMPLE |
| 31 | ------- |
| 32 | |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 33 | Suppose you run 'git tag -f' and mistype the tag to overwrite. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 34 | The ref to your tag is overwritten, but until you run 'git |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 35 | prune', the tag itself is still there. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 36 | |
| 37 | ------------ |
| 38 | $ git lost-found |
| 39 | [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c |
| 40 | ... |
| 41 | ------------ |
| 42 | |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 43 | Also you can use gitk to browse how any tags found relate to each |
| 44 | other. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 45 | |
| 46 | ------------ |
| 47 | $ gitk $(cd .git/lost-found/commit && echo ??*) |
| 48 | ------------ |
| 49 | |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 50 | After making sure you know which the object is the tag you are looking |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 51 | for, you can reconnect it to your regular `refs` hierarchy by using |
| 52 | the `update-ref` command. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 53 | |
| 54 | ------------ |
| 55 | $ git cat-file -t 1ef2b196 |
| 56 | tag |
| 57 | $ git cat-file tag 1ef2b196 |
| 58 | object fa41bbce8e38c67a218415de6cfa510c7e50032a |
| 59 | type commit |
| 60 | tag v0.99.9c |
| 61 | tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800 |
| 62 | |
| 63 | GIT 0.99.9c |
| 64 | |
| 65 | This 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 |
| 69 | 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6 |
| 70 | ------------ |
| 71 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 72 | GIT |
| 73 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 74 | Part of the linkgit:git[1] suite |