Common causes
- A git gc or git prune removed objects that the reflog still references
- Repo was transferred or cloned in a way that didn't include all objects
- Object store corruption from a disk or filesystem issue
- A shallow clone missing full history
How to fix it
- This is often just a warning — run git fsck to see if there are real errors: git fsck --full
- Clean up dangling refs: git gc --prune=now
- Expire old reflog entries: git reflog expire --all --expire=now
- If critical history is missing, check if the remote still has it: git fetch --all
Example
warning: reflog of 'HEAD' references a broken commit.
warning: reflog of 'refs/heads/main' references a broken commit.Running git gc or git fsck after object store corruption
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
