I am getting this error in my git repository:
22:09:15 $ git status
# On branch master
error: Could not read 8124cc15c63be92d534e4cdfa33c38d54deee122
error:
I had a similar issue just now. The corruption arose when my laptop did a hard power-off during a git pull
. I have a remote backup repository. First I had several object files in .git/objects/??/* that were zero size. After a cp -a
backup of the repository, I did this:
../fresh/
repositoryin the broken repository, I did
cat ../fresh/.git/objects/pack/pack-*.pack | git unpack-objects
This filled up the missing objects in the object database. The repository seems to be back up now.