I'm debugging a case of git repository corruption, caused by a hard drive failure. I have
>git fsck --full
fatal: loose object 25e9d8d2deb964c3da0f86f60bbd5a23e8387349 (stored in
.git/objects/25/e9d8d2deb964c3da0f86f60bbd5a23e8387349) is corrupt
>git show 25e9d8d2deb964c3da0f86f60bbd5a23e8387349
fatal: loose object 25e9d8d2deb964c3da0f86f60bbd5a23e8387349 (stored in
.git/objects/25/e9d8d2deb964c3da0f86f60bbd5a23e8387349) is corrupt
Now, I'd like to know something about this object - what it is, where does it belong ? (Which folder, which commit?)
When I try to investigate the object its stored in, I get:
>git show e9d8d2deb964c3da0f86f60bbd5a23e8387349
fatal: ambiguous argument 'e9d8d2deb964c3da0f86f60bbd5a23e8387349': unknown revision or
path not in the working tree. Use '--' to separate paths from revisions
How should I proceed?
I have a copy of the repository from earlier today, but I wouldn't want to just trash my local changes - I would prefer to see if I can fix the repo, or perhaps just trash a single commit.
P.S. - I found several threads about the "loose objects" problem, but nothing with concrete instructions on how to investigate/resolve, both in case where I do find a backup of the corrupt object in another repo, and in the case where there is no backup of this object.
P.S. 2 - Oddly enough, gitk --all
works well and doesn't care about this corrupt state.