Fatal: loose object is corrupt

git commit has stopped working on one of my repos… It yields the error

error: object file .git/objects/92/fce7855924ed3d0802e6b323b41bcabdc4b9b7 is empty
error: object file .git/objects/92/fce7855924ed3d0802e6b323b41bcabdc4b9b7 is empty
fatal: loose object 92fce7855924ed3d0802e6b323b41bcabdc4b9b7 (stored in .git/objects/92/fce7855924ed3d0802e6b323b41bcabdc4b9b7) is corrupt

Any ideas?

1 Like

Hey Luke!

You’ll want to first, make a backup of .git, like:

cp -a .git .git-old

Then:

git fsck --full

Which should return the same entries that you show in your post. You should then delete those empty files from .git/objects/

After deleting those objects, rerun:

git fsck --full

This may be all you need to do! Try your commit after this, and let us know if you continue to have problems. Depending on what you see next, will determine what you would need to do going forward.