Before starting I would like to tell that this may look like a duplicate question, but I have try those all & still facing the issue.
Now my issue is:
I was working in a local git branch suddenly the power went OFF & System turned OFF. Later, when power is back, I tried to pull my branch & it shown a message as:
../bug_11677 $ git pull
error: object file ./objects/3f/5774584d2f00d4adf0a82b5e2be0feee5c894a is empty
error: object file ./objects/3f/5774584d2f00d4adf0a82b5e2be0feee5c894a is empty
fatal: loose object 3f5774584d2f00d4adf0a82b5e2be0feee5c894a (stored in ./objects/3f/5774584d2f00d4adf0a82b5e2be0feee5c894a) is corrupt
I have tried:
Remove git index & tried to reset by keeping the changes in file:
git reset --keep
Tried by removing git object folder:
find .git/objects/ -type f -empty | xargs rm
git fetch -p
git fsck --full
Tried one as below:
rm -f .git/objects/3f/5774584d2f00d4adf0a82b5e2be0feee5c894a
git fsck --full
When I tried the last one, it shown:
Checking object directories: 100% (256/256), done.
Checking objects: 100% (342770/342770), done.
Checking connectivity: 342315, done.
Later I pulled the branch, then again I got the corrupted message.
- I have also tried to clone my branch newly, but failed by same error.
I have gone through below links: