GIT-FSCK(1)
π GIT-FSCK(1) π
okay bestie, welcome to the GIT-FSCK(1) page from the Git Manual β aka the glow-up check for your object database. This is git-fsck, and she is literally here to verify the connectivity and validity of the objects in the database. π
β¨ NAME β¨
git-fsck β Verifies the connectivity and validity of the objects in the database.
π¦ SYNOPSIS π¦
git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]
[--[no-]full] [--strict] [--verbose] [--lost-found]
[--[no-]dangling] [--[no-]progress] [--connectivity-only]
[--[no-]name-objects] [--[no-]references] [<object>...]
πΈ DESCRIPTION πΈ
Verifies the connectivity and validity of the objects in the database. Thatβs the whole main-character job, no cap. β¨
π OPTIONS π
<object>β an object to treat as the head of an unreachability trace. If you donβt give any objects,git fsckdefaults to using the index file, all SHA-1 references in the refs namespace, and all reflogs (unless--no-reflogsis given) as heads.--unreachableβ prints out objects that exist but that arenβt reachable from any of the reference nodes. Unreachable reveal time.--dangling,--no-danglingβ prints objects that exist but that are never directly used (this is the default).--no-danglingcan be used to omit this information from the output.--rootβ reports root nodes.--tagsβ reports tags.--cacheβ considers any object recorded in the index also as a head node for an unreachability trace.--no-reflogsβ do not consider commits that are referenced only by an entry in a reflog to be reachable. This option is meant only to search for commits that used to be in a ref, but now arenβt, but are still in that corresponding reflog.--fullβ check not just objects inGIT_OBJECT_DIRECTORY($GIT_DIR/objects), but also the ones found in alternate object pools listed inGIT_ALTERNATE_OBJECT_DIRECTORIESor$GIT_DIR/objects/info/alternates, and in packed Git archives found in$GIT_DIR/objects/packand corresponding pack subdirectories in alternate object pools. This is now default; you can turn it off with--no-full.--connectivity-onlyβ check only the connectivity of reachable objects, making sure that any objects referenced by a reachable tag, commit, or tree are present. This speeds up the operation by avoiding reading blobs entirely (though it does still check that referenced blobs exist). This will detect corruption in commits and trees, but not do any semantic checks (e.g., for format errors). Corruption in blob objects will not be detected at all. Unreachable tags, commits, and trees will also be accessed to find the tips of dangling segments of history. Use--no-danglingif you donβt care about this output and want to speed it up further. Speedy-ish, but know the tradeoffs, bestie.--strictβ enable more strict checking, namely to catch a file mode recorded withg+wbit set, which was created by older versions of Git. Existing repositories, including the Linux kernel, Git itself, and sparse repository have old objects that trigger this check, but it is recommended to check new projects with this flag.--verboseβ be chatty. π£οΈ--lost-foundβ write dangling objects into.git/lost-found/commit/or.git/lost-found/other/, depending on type. If the object is a blob, the contents are written into the file, rather than its object name.--name-objectsβ when displaying names of reachable objects, in addition to the SHA-1 also display a name that describes how they are reachable, compatible withgit-rev-parse(1), e.g.HEAD@{1234567890}~25^2:src/.--progress,--no-progressβ progress status is reported on the standard error stream by default when it is attached to a terminal, unless--no-progressor--verboseis specified.--progressforces progress status even if the standard error stream is not directed to a terminal.--references,--no-referencesβ control whether to check the references database consistency viagit refs verify. Seegit-refs(1)for details. The default is to check the references database. π«Ά
π§ CONFIGURATION π§
Everything below this line in this section is selectively included from the git-config(1) documentation. The content is the same as whatβs found there:
π fsck.<msg-id> π
During fsck git may find issues with legacy data which wouldnβt be generated by current versions of git, and which wouldnβt be sent over the wire if transfer.fsckObjects was set. This feature is intended to support working with legacy repositories containing such data.
Setting fsck.<msg-id> will be picked up by git-fsck(1), but to accept pushes of such data set receive.fsck.<msg-id> instead, or to clone or fetch it set fetch.fsck.<msg-id>.
The rest of the documentation discusses fsck.* for brevity, but the same applies for the corresponding receive.fsck.* and fetch.fsck.* variables.
Unlike variables like color.ui and core.editor, the receive.fsck.<msg-id> and fetch.fsck.<msg-id> variables will not fall back on the fsck.<msg-id> configuration if they arenβt set. To uniformly configure the same fsck settings in different circumstances, all three of them must be set to the same values.
When fsck.<msg-id> is set, errors can be switched to warnings and vice versa by configuring the fsck.<msg-id> setting where the <msg-id> is the fsck message ID and the value is one of error, warn or ignore. For convenience, fsck prefixes the error/warning with the message ID, e.g. "missingEmail: invalid author/committer line - missing email" means that setting fsck.missingEmail = ignore will hide that issue.
In general, it is better to enumerate existing objects with problems with fsck.skipList, instead of listing the kind of breakages these problematic objects share to be ignored, as doing the latter will allow new instances of the same breakages go unnoticed.
Setting an unknown fsck.<msg-id> value will cause fsck to die, but doing the same for receive.fsck.<msg-id> and fetch.fsck.<msg-id> will only cause git to warn.
See the Fsck Messages section of git-fsck(1) for supported values of <msg-id>.
π fsck.skipList π
The path to a list of object names (i.e. one unabbreviated SHA-1 per line) that are known to be broken in a non-fatal way and should be ignored. On versions of Git 2.20 and later, comments (#), empty lines, and any leading and trailing whitespace are ignored. Everything but a SHA-1 per line will error out on older versions.
This feature is useful when an established project should be accepted despite early commits containing errors that can be safely ignored, such as invalid committer email addresses. Note: corrupt objects cannot be skipped with this setting.
Like fsck.<msg-id> this variable has corresponding receive.fsck.skipList and fetch.fsck.skipList variants.
Unlike variables like color.ui and core.editor the receive.fsck.skipList and fetch.fsck.skipList variables will not fall back on the fsck.skipList configuration if they arenβt set. To uniformly configure the same fsck settings in different circumstances, all three of them must be set to the same values.
Older versions of Git (before 2.20) documented that the object names list should be sorted. This was never a requirement; the object names could appear in any order, but when reading the list we tracked whether the list was sorted for the purposes of an internal binary search implementation, which could save itself some work with an already sorted list. Unless you had a humongous list there was no reason to go out of your way to pre-sort the list. After Git version 2.20 a hash implementation is used instead, so thereβs now no reason to pre-sort the list.
π₯ DISCUSSION π₯
git-fsck tests SHA-1 and general object sanity, and it does full tracking of the resulting reachability and everything else. It prints out any corruption it finds (missing or bad objects), and if you use the --unreachable flag it will also print out objects that exist but that arenβt reachable from any of the specified head nodes (or the default set, as mentioned above).
Any corrupt objects you will have to find in backups or other archives (i.e., you can just remove them and do an rsync with some other site in the hopes that somebody else has the object you have corrupted).
If core.commitGraph is true, the commit-graph file will also be inspected using git commit-graph verify. See git-commit-graph(1).
π EXTRACTED DIAGNOSTICS π
unreachable <type> <object>β the<type>object<object>, isnβt actually referred to directly or indirectly in any of the trees or commits seen. This can mean that thereβs another root node that youβre not specifying or that the tree is corrupt. If you havenβt missed a root node then you might as well delete unreachable nodes since they canβt be used.missing <type> <object>β the<type>object<object>, is referred to but isnβt present in the database. πdangling <type> <object>β the<type>object<object>, is present in the database but never directly used. A dangling commit could be a root node.hash mismatch <object>β the database has an object whose hash doesnβt match the object database value. This indicates a serious data integrity problem. π
πΈ FSCK MESSAGES πΈ
Okay bestie, hereβs the tea β: this is the full roster of error types git fsck can detect, what each one means, and its default severity. The severity for anything not marked (FATAL) can be tweaked by setting the matching fsck.<msg-id> configuration variable. The (FATAL) ones? Yeah, those are locked in β no negotiation π
.
badDateβ (ERROR) The date format in an author/committer line is invalid.badDateOverflowβ (ERROR) The date value in an author/committer line is invalid.badEmailβ (ERROR) The email format in an author/committer line is invalid.badFilemodeβ (INFO) A tree contains a bad filemode entry.badGpgsigβ (ERROR) A tag contains a bad (truncated) signature header, likegpgsig.badHeadTargetβ (ERROR) TheHEADref is a symref that doesnβt refer to a branch.badHeaderContinuationβ (ERROR) A continuation header β thinkgpgsigβ is unexpectedly truncated.badNameβ (ERROR) An author/committer name is empty.badObjectSha1β (ERROR) An object has a bad sha1.badPackedRefEntryβ (ERROR) The"packed-refs"file contains an invalid entry.badPackedRefHeaderβ (ERROR) The"packed-refs"file contains an invalid header.badParentSha1β (ERROR) A commit object has a bad parent sha1.badRefContentβ (ERROR) A ref has bad content.badRefFiletypeβ (ERROR) A ref has a bad file type.badRefNameβ (ERROR) A ref has an invalid format.badRefOidβ (ERROR) A ref points to an invalid object ID.badReferentNameβ (ERROR) The referent name of a symref is invalid.badReftableTableNameβ (WARN) A reftable table has an invalid name.badTagNameβ (INFO) A tag has an invalid format.badTimezoneβ (ERROR) Found an invalid time zone in an author/committer line.badTreeβ (ERROR) A tree cannot be parsed.badTreeSha1β (ERROR) A tree has an invalid format.badTypeβ (ERROR) Found an invalid object type.duplicateEntriesβ (ERROR) A tree contains duplicate file entries.emptyNameβ (WARN) A path contains an empty name.emptyPackedRefsFileβ (INFO) The"packed-refs"file is empty. If you see this error, report it to thegit@vger.kernel.orgmailing list [1]. Only very early versions of Git would create such an empty"packed_refs"file, so we might tighten this rule in the future.extraHeaderEntryβ (IGNORE) Extra headers found aftertagger.fullPathnameβ (WARN) A path contains the full path starting with"/".gitattributesBlobβ (ERROR) A non-blob found at.gitattributes.gitattributesLargeβ (ERROR) The.gitattributesblob is too large.gitattributesLineLengthβ (ERROR) The.gitattributesblob contains lines that are too long.gitattributesMissingβ (ERROR) Unable to read the.gitattributesblob.gitattributesSymlinkβ (INFO).gitattributesis a symlink.gitignoreSymlinkβ (INFO).gitignoreis a symlink.gitmodulesBlobβ (ERROR) A non-blob found at.gitmodules.gitmodulesLargeβ (ERROR) The.gitmodulesfile is too large to parse.gitmodulesMissingβ (ERROR) Unable to read the.gitmodulesblob.gitmodulesNameβ (ERROR) A submodule name is invalid.gitmodulesParseβ (INFO) Could not parse the.gitmodulesblob.gitmodulesPathβ (ERROR) The.gitmodulespath is invalid.gitmodulesSymlinkβ (ERROR).gitmodulesis a symlink.gitmodulesUpdateβ (ERROR) Found an invalid submodule update setting.gitmodulesUrlβ (ERROR) Found an invalid submodule url.hasDotβ (WARN) A tree contains an entry named.hasDotdotβ (WARN) A tree contains an entry named..hasDotgitβ (WARN) A tree contains an entry named.git.largePathnameβ (WARN) A tree contains an entry with a very long path name. If the value offsck.largePathnamecontains a colon, that value is used as the maximum allowable length β for example,"warn:10"would complain about any path component of 11 or more bytes. The default value is4096.mailmapSymlinkβ (INFO).mailmapis a symlink.missingAuthorβ (ERROR) Author is missing.missingCommitterβ (ERROR) Committer is missing.missingEmailβ (ERROR) Email is missing in an author/committer line.missingNameBeforeEmailβ (ERROR) Missing name before an email in an author/committer line.missingObjectβ (ERROR) Missing object line in a tag object.missingSpaceBeforeDateβ (ERROR) Missing space before the date in an author/committer line.missingSpaceBeforeEmailβ (ERROR) Missing space before the email in an author/committer line.missingTagβ (ERROR) Unexpected end after the type line in a tag object.missingTagEntryβ (ERROR) Missing tag line in a tag object.missingTaggerEntryβ (INFO) Missing tagger line in a tag object.missingTreeβ (ERROR) Missing tree line in a commit object.missingTypeβ (ERROR) Invalid type value on the type line in a tag object.missingTypeEntryβ (ERROR) Missing type line in a tag object.multipleAuthorsβ (ERROR) Multiple author lines found in a commit.nulInCommitβ (WARN) Found a NUL byte in the commit object body.nulInHeaderβ (FATAL) A NUL byte exists in the object header.nullSha1β (WARN) A tree contains entries pointing to a null sha1.packedRefEntryNotTerminatedβ (ERROR) The"packed-refs"file contains an entry that isnβt terminated by a newline.packedRefUnsortedβ (ERROR) The"packed-refs"file isnβt sorted.refMissingNewlineβ (INFO) A loose ref doesnβt end with newline (LF). Valid Git implementations never created such a loose ref file, so this may become an error in the future. If you see this error, report it to thegit@vger.kernel.orgmailing list [1], because we need to know what tools created such a file.symlinkRefβ (INFO) A symbolic link is used as a symref. If you see this error, report it to thegit@vger.kernel.orgmailing list [1], because weβre assessing the feasibility of dropping the support to drop creating symbolic links as symrefs.symrefTargetIsNotARefβ (INFO) The target of a symbolic reference points neither to a root reference nor to a reference starting with"refs/". Although we allow creating a symref pointing to a referent outside the"ref"by usinggit symbolic-ref, we may tighten the rule in the future. If you see this error, report it to thegit@vger.kernel.orgmailing list [1], because we need to know what tools created such a file.trailingRefContentβ (INFO) A loose ref has trailing content. Valid Git implementations never created such a loose ref file, so this may become an error in the future. If you see this error, report it to thegit@vger.kernel.orgmailing list [1], because we need to know what tools created such a file.treeNotSortedβ (ERROR) A tree isnβt properly sorted.unknownTypeβ (ERROR) Found an unknown object type.unterminatedHeaderβ (FATAL) Missing end-of-line in the object header.zeroPaddedDateβ (ERROR) Found a zero padded date in an author/committer line.zeroPaddedFilemodeβ (WARN) Found a zero padded filemode in a tree.
πΏ ENVIRONMENT VARIABLES πΏ
GIT_OBJECT_DIRECTORYβ used to specify the object database root (usually$GIT_DIR/objects).GIT_INDEX_FILEβ used to specify the index file of the index.GIT_ALTERNATE_OBJECT_DIRECTORIESβ used to specify additional object database roots (usually unset).
π«Ά GIT π«Ά
Part of the git(1) suite. Iconic behavior, honestly π.
π NOTES π
git@vger.kernel.orgβmailto:git@vger.kernel.org
Thatβs the whole vibe check, bestie π This page is serving Git 2.56.0 realness, dated 2026-09-27 β periodt. πβ¨
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms