E001
git
data_error
ai_generated
true
error: object file .git/objects/ab/cdef1234 is empty
ID: git/object-corruption-empty-file
80%Fix Rate
85%Confidence
1Evidence
2025-01-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| git 2.38 | active | — | — | — |
| git 2.43 | active | — | — | — |
| git 2.45 | active | — | — | — |
Root Cause
A git object file in the repository is empty due to disk corruption, improper shutdown, or manual tampering.
generic中文
由于磁盘损坏、不当关机或手动篡改,仓库中的 git 对象文件为空。
Official Documentation
https://git-scm.com/docs/git-fsckWorkarounds
-
85% success Restore the empty object from a backup or remote: git fetch origin refs/heads/main:refs/remotes/origin/main, then git fsck to verify
Restore the empty object from a backup or remote: git fetch origin refs/heads/main:refs/remotes/origin/main, then git fsck to verify
-
75% success Use git unpack-objects to rebuild objects from pack files if available
Use git unpack-objects to rebuild objects from pack files if available
-
70% success As a last resort, clone the repo again and cherry-pick uncommitted changes from the broken clone
As a last resort, clone the repo again and cherry-pick uncommitted changes from the broken clone
中文步骤
Restore the empty object from a backup or remote: git fetch origin refs/heads/main:refs/remotes/origin/main, then git fsck to verify
Use git unpack-objects to rebuild objects from pack files if available
As a last resort, clone the repo again and cherry-pick uncommitted changes from the broken clone
Dead Ends
Common approaches that don't work:
-
Delete the empty object file manually
90% fail
Breaks repository integrity; git will complain about missing objects and may refuse to operate.
-
Run git fsck without fixing first
70% fail
fsck only reports errors, does not repair; may lead to further confusion.
-
Re-clone the entire repository
40% fail
Overkill if only one object is corrupt; also loses uncommitted local changes.