While running ‘git gc’ I get the following errors:
chris@chris-VirtualBox:~/code/dataquality$ git gc --aggressive
Counting objects: 3849, done.
error: object file .git/objects/1e/6a84c4e4202c469c188b69fd23407fca44d69d is empty
error: unable to find 1e6a84c4e4202c469c188b69fd23407fca44d69d
error: object file .git/objects/95/9dbfcdfd3ef09088e652d4e5526df66bc53323 is empty
error: unable to find 959dbfcdfd3ef09088e652d4e5526df66bc53323
error: object file .git/objects/9c/3f15a856fda402d82131bb9ea35ea7d27ae05d is empty
error: unable to find 9c3f15a856fda402d82131bb9ea35ea7d27ae05d
error: object file .git/objects/cf/bdc18aab11c9cbada9fb1ac73c347352b7a4fb is empty
error: unable to find cfbdc18aab11c9cbada9fb1ac73c347352b7a4fb
error: object file .git/objects/db/0ee0587a14cc0cdfa43ccda0d0b2010c7701b6 is empty
error: unable to find db0ee0587a14cc0cdfa43ccda0d0b2010c7701b6
Delta compression using up to 8 threads.
Compressing objects: 100% (3539/3539), done.
error: object file .git/objects/db/0ee0587a14cc0cdfa43ccda0d0b2010c7701b6 is empty
fatal: loose object db0ee0587a14cc0cdfa43ccda0d0b2010c7701b6 (stored in .git/objects/db/0ee0587a14cc0cdfa43ccda0d0b2010c7701b6) is corrupt
error: failed to run repack
I have no clue how to resolve the errors. What steps should I take?
When I run git fsck --full this is the output:
chris@chris-VirtualBox:~/code/dataquality$ git fsck --full
error: object file .git/objects/1e/6a84c4e4202c469c188b69fd23407fca44d69d is empty
fatal: loose object 1e6a84c4e4202c469c188b69fd23407fca44d69d (stored in .git/objects/1e/6a84c4e4202c469c188b69fd23407fca44d69d) is corrupt
Since
git fsck --fullreturned the same errors on the new clone the corrupt objects are used in a branch. The discussion section fromgit help fsckhas this to say about your situation:So if you have an older clone with this object you may be able to recover. If you don’t have a backup this answer may be useful to you.