git corruption ai_generated true

broken link from tree abc123 to blob def456

ID: git/fsck-broken-link

Also available as: JSON · Markdown
75%Fix Rate
80%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

git fsck reports broken links between objects, indicating missing or corrupted objects in the repository. Usually caused by disk corruption, interrupted gc operations, or shallow clone issues.

generic

Workarounds

  1. 82% success Fetch missing objects from the remote
    Run git fetch --all to retrieve objects from all remotes. Then run git fsck again to verify. Missing objects from the remote fill in the broken links.
  2. 95% success Re-clone the repository if corruption is extensive
    Backup any local-only branches by creating patches (git format-patch), then re-clone. Apply patches to the fresh clone to recover local work.

Dead Ends

Common approaches that don't work:

  1. Running git gc --aggressive to fix the broken links 85% fail

    gc cannot recreate missing objects; it may actually make things worse by removing dangling objects that could help with recovery

  2. Ignoring the fsck warnings and continuing to use the repo 70% fail

    Broken links can cascade during merge/rebase operations, leading to data loss when git tries to read the missing objects

Error Chain

Leads to:
Preceded by:
Frequently confused with: