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
4 <article lang="en" id="git-fsck(1)">
\r
6 <title>git-fsck(1)</title>
\r
8 <primary>git-fsck(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-fsck - Verifies the connectivity and validity of the objects in the database</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\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] [<object>*]</literallayout>
\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
27 <simplesect id="_options">
\r
28 <title>OPTIONS</title>
\r
36 An object to treat as the head of an unreachability trace.
\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
49 Print out objects that exist but that aren't reachable from any
\r
50 of the reference nodes.
\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
94 Consider any object recorded in the index also as a head node for
\r
95 an unreachability trace.
\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
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
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
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
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
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
198 <simplesect id="_extracted_diagnostics">
\r
199 <title>Extracted Diagnostics</title>
\r
203 expect dangling commits - potential heads - due to lack of head information
\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
215 missing sha1 directory <emphasis><dir></emphasis>
\r
219 The directory holding the sha1 objects is missing.
\r
225 unreachable <type> <object>
\r
229 The <type> object <object>, 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
240 missing <type> <object>
\r
244 The <type> object <object>, is referred to but isn't present in
\r
251 dangling <type> <object>
\r
255 The <type> object <object>, is present in the database but never
\r
256 <emphasis>directly</emphasis> used. A dangling commit could be a root node.
\r
262 sha1 mismatch <object>
\r
266 The database has an object who's sha1 doesn't match the
\r
268 This indicates a serious data integrity problem.
\r
274 <simplesect id="_environment_variables">
\r
275 <title>Environment Variables</title>
\r
279 GIT_OBJECT_DIRECTORY
\r
283 used to specify the object database root (usually $GIT_DIR/objects)
\r
293 used to specify the index file of the index
\r
299 GIT_ALTERNATE_OBJECT_DIRECTORIES
\r
303 used to specify additional object database roots (usually unset)
\r
309 <simplesect id="_git">
\r
311 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r