updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-fsck.xml
blobf8b4b31fe9df9978d043cc0e3ade322b95c15aa4
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-fsck(1)">\r
5 <articleinfo>\r
6     <title>git-fsck(1)</title>\r
7 <indexterm>\r
8 <primary>git-fsck(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-fsck - Verifies the connectivity and validity of the objects in the database</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git fsck</emphasis> [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\r
19          [--[no-]full] [--strict] [--verbose] [--lost-found]\r
20          [--[no-]dangling] [--[no-]progress] [&lt;object&gt;*]</literallayout>\r
21 </blockquote>\r
22 </simplesect>\r
23 <simplesect id="_description">\r
24 <title>DESCRIPTION</title>\r
25 <simpara>Verifies the connectivity and validity of the objects in the database.</simpara>\r
26 </simplesect>\r
27 <simplesect id="_options">\r
28 <title>OPTIONS</title>\r
29 <variablelist>\r
30 <varlistentry>\r
31 <term>\r
32 &lt;object&gt;\r
33 </term>\r
34 <listitem>\r
35 <simpara>\r
36         An object to treat as the head of an unreachability trace.\r
37 </simpara>\r
38 <simpara>If no objects are given, <emphasis>git fsck</emphasis> defaults to using the\r
39 index file, all SHA1 references in .git/refs/*, and all reflogs (unless\r
40 --no-reflogs is given) as heads.</simpara>\r
41 </listitem>\r
42 </varlistentry>\r
43 <varlistentry>\r
44 <term>\r
45 --unreachable\r
46 </term>\r
47 <listitem>\r
48 <simpara>\r
49         Print out objects that exist but that aren't reachable from any\r
50         of the reference nodes.\r
51 </simpara>\r
52 </listitem>\r
53 </varlistentry>\r
54 <varlistentry>\r
55 <term>\r
56 --dangling\r
57 </term>\r
58 <term>\r
59 --no-dangling\r
60 </term>\r
61 <listitem>\r
62 <simpara>\r
63         Print objects that exist but that are never <emphasis>directly</emphasis> used (default).\r
64         <emphasis>--no-dangling</emphasis> can be used to omit this information from the output.\r
65 </simpara>\r
66 </listitem>\r
67 </varlistentry>\r
68 <varlistentry>\r
69 <term>\r
70 --root\r
71 </term>\r
72 <listitem>\r
73 <simpara>\r
74         Report root nodes.\r
75 </simpara>\r
76 </listitem>\r
77 </varlistentry>\r
78 <varlistentry>\r
79 <term>\r
80 --tags\r
81 </term>\r
82 <listitem>\r
83 <simpara>\r
84         Report tags.\r
85 </simpara>\r
86 </listitem>\r
87 </varlistentry>\r
88 <varlistentry>\r
89 <term>\r
90 --cache\r
91 </term>\r
92 <listitem>\r
93 <simpara>\r
94         Consider any object recorded in the index also as a head node for\r
95         an unreachability trace.\r
96 </simpara>\r
97 </listitem>\r
98 </varlistentry>\r
99 <varlistentry>\r
100 <term>\r
101 --no-reflogs\r
102 </term>\r
103 <listitem>\r
104 <simpara>\r
105         Do not consider commits that are referenced only by an\r
106         entry in a reflog to be reachable.  This option is meant\r
107         only to search for commits that used to be in a ref, but\r
108         now aren't, but are still in that corresponding reflog.\r
109 </simpara>\r
110 </listitem>\r
111 </varlistentry>\r
112 <varlistentry>\r
113 <term>\r
114 --full\r
115 </term>\r
116 <listitem>\r
117 <simpara>\r
118         Check not just objects in GIT_OBJECT_DIRECTORY\r
119         ($GIT_DIR/objects), but also the ones found in alternate\r
120         object pools listed in GIT_ALTERNATE_OBJECT_DIRECTORIES\r
121         or $GIT_DIR/objects/info/alternates,\r
122         and in packed git archives found in $GIT_DIR/objects/pack\r
123         and corresponding pack subdirectories in alternate\r
124         object pools.  This is now default; you can turn it off\r
125         with --no-full.\r
126 </simpara>\r
127 </listitem>\r
128 </varlistentry>\r
129 <varlistentry>\r
130 <term>\r
131 --strict\r
132 </term>\r
133 <listitem>\r
134 <simpara>\r
135         Enable more strict checking, namely to catch a file mode\r
136         recorded with g+w bit set, which was created by older\r
137         versions of git.  Existing repositories, including the\r
138         Linux kernel, git itself, and sparse repository have old\r
139         objects that triggers this check, but it is recommended\r
140         to check new projects with this flag.\r
141 </simpara>\r
142 </listitem>\r
143 </varlistentry>\r
144 <varlistentry>\r
145 <term>\r
146 --verbose\r
147 </term>\r
148 <listitem>\r
149 <simpara>\r
150         Be chatty.\r
151 </simpara>\r
152 </listitem>\r
153 </varlistentry>\r
154 <varlistentry>\r
155 <term>\r
156 --lost-found\r
157 </term>\r
158 <listitem>\r
159 <simpara>\r
160         Write dangling objects into .git/lost-found/commit/ or\r
161         .git/lost-found/other/, depending on type.  If the object is\r
162         a blob, the contents are written into the file, rather than\r
163         its object name.\r
164 </simpara>\r
165 </listitem>\r
166 </varlistentry>\r
167 <varlistentry>\r
168 <term>\r
169 --progress\r
170 </term>\r
171 <term>\r
172 --no-progress\r
173 </term>\r
174 <listitem>\r
175 <simpara>\r
176         Progress status is reported on the standard error stream by\r
177         default when it is attached to a terminal, unless\r
178         --no-progress or --verbose is specified. --progress forces\r
179         progress status even if the standard error stream is not\r
180         directed to a terminal.\r
181 </simpara>\r
182 </listitem>\r
183 </varlistentry>\r
184 </variablelist>\r
185 </simplesect>\r
186 <simplesect id="_discussion">\r
187 <title>DISCUSSION</title>\r
188 <simpara>git-fsck tests SHA1 and general object sanity, and it does full tracking\r
189 of the resulting reachability and everything else. It prints out any\r
190 corruption it finds (missing or bad objects), and if you use the\r
191 <emphasis>--unreachable</emphasis> flag it will also print out objects that exist but that\r
192 aren't reachable from any of the specified head nodes (or the default\r
193 set, as mentioned above).</simpara>\r
194 <simpara>Any corrupt objects you will have to find in backups or other archives\r
195 (i.e., you can just remove them and do an <emphasis>rsync</emphasis> with some other site in\r
196 the hopes that somebody else has the object you have corrupted).</simpara>\r
197 </simplesect>\r
198 <simplesect id="_extracted_diagnostics">\r
199 <title>Extracted Diagnostics</title>\r
200 <variablelist>\r
201 <varlistentry>\r
202 <term>\r
203 expect dangling commits - potential heads - due to lack of head information\r
204 </term>\r
205 <listitem>\r
206 <simpara>\r
207         You haven't specified any nodes as heads so it won't be\r
208         possible to differentiate between un-parented commits and\r
209         root nodes.\r
210 </simpara>\r
211 </listitem>\r
212 </varlistentry>\r
213 <varlistentry>\r
214 <term>\r
215 missing sha1 directory <emphasis>&lt;dir&gt;</emphasis>\r
216 </term>\r
217 <listitem>\r
218 <simpara>\r
219         The directory holding the sha1 objects is missing.\r
220 </simpara>\r
221 </listitem>\r
222 </varlistentry>\r
223 <varlistentry>\r
224 <term>\r
225 unreachable &lt;type&gt; &lt;object&gt;\r
226 </term>\r
227 <listitem>\r
228 <simpara>\r
229         The &lt;type&gt; object &lt;object&gt;, isn't actually referred to directly\r
230         or indirectly in any of the trees or commits seen. This can\r
231         mean that there's another root node that you're not specifying\r
232         or that the tree is corrupt. If you haven't missed a root node\r
233         then you might as well delete unreachable nodes since they\r
234         can't be used.\r
235 </simpara>\r
236 </listitem>\r
237 </varlistentry>\r
238 <varlistentry>\r
239 <term>\r
240 missing &lt;type&gt; &lt;object&gt;\r
241 </term>\r
242 <listitem>\r
243 <simpara>\r
244         The &lt;type&gt; object &lt;object&gt;, is referred to but isn't present in\r
245         the database.\r
246 </simpara>\r
247 </listitem>\r
248 </varlistentry>\r
249 <varlistentry>\r
250 <term>\r
251 dangling &lt;type&gt; &lt;object&gt;\r
252 </term>\r
253 <listitem>\r
254 <simpara>\r
255         The &lt;type&gt; object &lt;object&gt;, is present in the database but never\r
256         <emphasis>directly</emphasis> used. A dangling commit could be a root node.\r
257 </simpara>\r
258 </listitem>\r
259 </varlistentry>\r
260 <varlistentry>\r
261 <term>\r
262 sha1 mismatch &lt;object&gt;\r
263 </term>\r
264 <listitem>\r
265 <simpara>\r
266         The database has an object who's sha1 doesn't match the\r
267         database value.\r
268         This indicates a serious data integrity problem.\r
269 </simpara>\r
270 </listitem>\r
271 </varlistentry>\r
272 </variablelist>\r
273 </simplesect>\r
274 <simplesect id="_environment_variables">\r
275 <title>Environment Variables</title>\r
276 <variablelist>\r
277 <varlistentry>\r
278 <term>\r
279 GIT_OBJECT_DIRECTORY\r
280 </term>\r
281 <listitem>\r
282 <simpara>\r
283         used to specify the object database root (usually $GIT_DIR/objects)\r
284 </simpara>\r
285 </listitem>\r
286 </varlistentry>\r
287 <varlistentry>\r
288 <term>\r
289 GIT_INDEX_FILE\r
290 </term>\r
291 <listitem>\r
292 <simpara>\r
293         used to specify the index file of the index\r
294 </simpara>\r
295 </listitem>\r
296 </varlistentry>\r
297 <varlistentry>\r
298 <term>\r
299 GIT_ALTERNATE_OBJECT_DIRECTORIES\r
300 </term>\r
301 <listitem>\r
302 <simpara>\r
303         used to specify additional object database roots (usually unset)\r
304 </simpara>\r
305 </listitem>\r
306 </varlistentry>\r
307 </variablelist>\r
308 </simplesect>\r
309 <simplesect id="_git">\r
310 <title>GIT</title>\r
311 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
312 </simplesect>\r
313 </article>\r