Verify a Repository With git fsck

Check for missing, corrupt or dangling objects in the object database.

macOSbackupgitcliLow risk
Run git fsck --full to verify all objects and connectivity.

01Command

Command
$ git fsck --full

02What it does

fsck walks the object graph and reports corrupt or unreachable objects, which is the right check after a disk error, an interrupted transfer or before trusting a backup. It is the command-line equivalent of an integrity audit.

03Risk

RiskLow risk
RequirementsGit 2.20+ (install with Homebrew or Xcode Command Line Tools)
CompatibilitymacOS with Git installed (Homebrew or Xcode Command Line Tools)
!Warning: Dangling objects are usually harmless leftovers; investigate missing or corrupt objects promptly and restore from a known-good backup.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • git-fsck documentation
    Git · vendor-doc · 2026-09-20
    Evidence: Documents git fsck, which verifies connectivity and validity of objects.

Last verified: 2026-10-13 · Category: Developer

06Related solutions