Interview Prep/Git & GitHub/Repository Health, Size and Performance

`git fsck` prints dozens of `dangling commit ...` and `dangling blob ...` lines. Is the repo broken?

BeginnerTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → No. Dangling objects are normal leftovers from amends, rebases, resets, dropped stashes and git add of content you never committed. They are unreachable but harmless and get pruned by gc after the expiry window.

Diagnose →

git fsck --no-dangling          # shows only real problems
git fsck --lost-found           # copies dangling commits/blobs to .git/lost-found/ for inspection

Fix → Nothing to fix. If you are looking for lost work, inspect them: git show <sha>. Otherwise let git gc clean up, or git prune --expire=now if you are sure.

Prevent → Learn the difference: "dangling" is fine, "missing", "broken link" and "corrupt" are not.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance