1GIT-FSCK(1)                       Git Manual                       GIT-FSCK(1)
2
3
4

NAME

6       git-fsck - Verifies the connectivity and validity of the objects in the
7       database
8

SYNOPSIS

10       git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]
11                [--[no-]full] [--strict] [--verbose] [--lost-found]
12                [--[no-]dangling] [--[no-]progress] [<object>*]
13
14

DESCRIPTION

16       Verifies the connectivity and validity of the objects in the database.
17

OPTIONS

19       <object>
20           An object to treat as the head of an unreachability trace.
21
22           If no objects are given, git fsck defaults to using the index file,
23           all SHA-1 references in refs namespace, and all reflogs (unless
24           --no-reflogs is given) as heads.
25
26       --unreachable
27           Print out objects that exist but that aren’t reachable from any of
28           the reference nodes.
29
30       --[no-]dangling
31           Print objects that exist but that are never directly used
32           (default).  --no-dangling can be used to omit this information from
33           the output.
34
35       --root
36           Report root nodes.
37
38       --tags
39           Report tags.
40
41       --cache
42           Consider any object recorded in the index also as a head node for
43           an unreachability trace.
44
45       --no-reflogs
46           Do not consider commits that are referenced only by an entry in a
47           reflog to be reachable. This option is meant only to search for
48           commits that used to be in a ref, but now aren’t, but are still in
49           that corresponding reflog.
50
51       --full
52           Check not just objects in GIT_OBJECT_DIRECTORY ($GIT_DIR/objects),
53           but also the ones found in alternate object pools listed in
54           GIT_ALTERNATE_OBJECT_DIRECTORIES or
55           $GIT_DIR/objects/info/alternates, and in packed Git archives found
56           in $GIT_DIR/objects/pack and corresponding pack subdirectories in
57           alternate object pools. This is now default; you can turn it off
58           with --no-full.
59
60       --strict
61           Enable more strict checking, namely to catch a file mode recorded
62           with g+w bit set, which was created by older versions of Git.
63           Existing repositories, including the Linux kernel, Git itself, and
64           sparse repository have old objects that triggers this check, but it
65           is recommended to check new projects with this flag.
66
67       --verbose
68           Be chatty.
69
70       --lost-found
71           Write dangling objects into .git/lost-found/commit/ or
72           .git/lost-found/other/, depending on type. If the object is a blob,
73           the contents are written into the file, rather than its object
74           name.
75
76       --[no-]progress
77           Progress status is reported on the standard error stream by default
78           when it is attached to a terminal, unless --no-progress or
79           --verbose is specified. --progress forces progress status even if
80           the standard error stream is not directed to a terminal.
81

DISCUSSION

83       git-fsck tests SHA-1 and general object sanity, and it does full
84       tracking of the resulting reachability and everything else. It prints
85       out any corruption it finds (missing or bad objects), and if you use
86       the --unreachable flag it will also print out objects that exist but
87       that aren’t reachable from any of the specified head nodes (or the
88       default set, as mentioned above).
89
90       Any corrupt objects you will have to find in backups or other archives
91       (i.e., you can just remove them and do an rsync with some other site in
92       the hopes that somebody else has the object you have corrupted).
93

EXTRACTED DIAGNOSTICS

95       expect dangling commits - potential heads - due to lack of head
96       information
97           You haven’t specified any nodes as heads so it won’t be possible to
98           differentiate between un-parented commits and root nodes.
99
100       missing sha1 directory <dir>
101           The directory holding the sha1 objects is missing.
102
103       unreachable <type> <object>
104           The <type> object <object>, isn’t actually referred to directly or
105           indirectly in any of the trees or commits seen. This can mean that
106           there’s another root node that you’re not specifying or that the
107           tree is corrupt. If you haven’t missed a root node then you might
108           as well delete unreachable nodes since they can’t be used.
109
110       missing <type> <object>
111           The <type> object <object>, is referred to but isn’t present in the
112           database.
113
114       dangling <type> <object>
115           The <type> object <object>, is present in the database but never
116           directly used. A dangling commit could be a root node.
117
118       sha1 mismatch <object>
119           The database has an object who’s sha1 doesn’t match the database
120           value. This indicates a serious data integrity problem.
121

ENVIRONMENT VARIABLES

123       GIT_OBJECT_DIRECTORY
124           used to specify the object database root (usually $GIT_DIR/objects)
125
126       GIT_INDEX_FILE
127           used to specify the index file of the index
128
129       GIT_ALTERNATE_OBJECT_DIRECTORIES
130           used to specify additional object database roots (usually unset)
131

GIT

133       Part of the git(1) suite
134
135
136
137Git 1.8.3.1                       11/19/2018                       GIT-FSCK(1)
Impressum