updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-lost-found.xml
blob739ac91261fed3b25e20c68e6cefe676047e21ff
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-lost-found(1)">\r
5 <articleinfo>\r
6     <title>git-lost-found(1)</title>\r
7 <indexterm>\r
8 <primary>git-lost-found(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-lost-found - Recover lost refs that luckily have not yet been pruned</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git lost-found</emphasis></literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="_description">\r
22 <title>DESCRIPTION</title>\r
23 <simpara><emphasis role="strong">NOTE</emphasis>: this command is deprecated.  Use <xref linkend="git-fsck(1)" /> with\r
24 the option <emphasis>--lost-found</emphasis> instead.</simpara>\r
25 <simpara>Finds dangling commits and tags from the object database, and\r
26 creates refs to them in the .git/lost-found/ directory.  Commits and\r
27 tags that dereference to commits are stored in .git/lost-found/commit,\r
28 and other objects are stored in .git/lost-found/other.</simpara>\r
29 </simplesect>\r
30 <simplesect id="_output">\r
31 <title>OUTPUT</title>\r
32 <simpara>Prints to standard output the object names and one-line descriptions\r
33 of any commits or tags found.</simpara>\r
34 </simplesect>\r
35 <simplesect id="_example">\r
36 <title>EXAMPLE</title>\r
37 <simpara>Suppose you run <emphasis>git tag -f</emphasis> and mistype the tag to overwrite.\r
38 The ref to your tag is overwritten, but until you run <emphasis>git\r
39 prune</emphasis>, the tag itself is still there.</simpara>\r
40 <screen>$ git lost-found\r
41 [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c\r
42 ...</screen>\r
43 <simpara>Also you can use gitk to browse how any tags found relate to each\r
44 other.</simpara>\r
45 <screen>$ gitk $(cd .git/lost-found/commit &amp;&amp; echo ??*)</screen>\r
46 <simpara>After making sure you know which the object is the tag you are looking\r
47 for, you can reconnect it to your regular .git/refs hierarchy.</simpara>\r
48 <screen>$ git cat-file -t 1ef2b196\r
49 tag\r
50 $ git cat-file tag 1ef2b196\r
51 object fa41bbce8e38c67a218415de6cfa510c7e50032a\r
52 type commit\r
53 tag v0.99.9c\r
54 tagger Junio C Hamano &lt;junkio@cox.net&gt; 1131059594 -0800\r
56 GIT 0.99.9c\r
58 This contains the following changes from the "master" branch, since\r
59 ...\r
60 $ git update-ref refs/tags/not-lost-anymore 1ef2b196\r
61 $ git rev-parse not-lost-anymore\r
62 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6</screen>\r
63 </simplesect>\r
64 <simplesect id="_git">\r
65 <title>GIT</title>\r
66 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
67 </simplesect>\r
68 </article>\r