Is there any way I can repair my repository with commit history in tact.
# git log
fatal: object 01aeb2bf2e93b238f0e0422816b3e55518321ae7 is corrupted
From reading the link below it looks like I'll have zap it and start over.
Is there any way I can repair my repository with commit history in tact.
# git log
fatal: object 01aeb2bf2e93b238f0e0422816b3e55518321ae7 is corrupted
From reading the link below it looks like I'll have zap it and start over.
Do you have clones of this repository elsewhere? You might want to read this post by Linus Torvalds to restore that corrupted object, assuming the corrupted object is a blob (file contents).
I wound up in the same situation, probably due to an improper shutdown of the virtual machine I was working in. There were approximately 10 objects in .git/objects that had zero length. As far as I can tell, the actual source code files were fine, just the repository was hosed.
$ git status
fatal: object fbcf234634ee04f8406cfd250ce5ab8012f92b08 is corrupted
Per some suggestions I saw elsewhere (including Linus's post referenced above), I tried temporarily moving the corrupted objects git was complaining about from .git/objects elsewhere. When had moved all of them, I got:
$ git status
fatal: bad object HEAD
After about an hour of Googling and trying various solutions, I gave up and started a new working copy using 'git clone' to pull from the origin (which was about 2 hours behind my working copy). I then used rsync -rC
(-C excludes SCM files) to copy the changed files from the messed-up working copy to my new working copy.