Re: corrupted Git repository
- From
Kasra Khosoussi <kasra.mail@gmail.com>
- Date
- Jun 21, 2011, 09:30 UTC
- Message-ID
- <BANLkTi=WVTGcGkUXjkuPYcxhMY0a5KPB7g@mail.gmail.com>
- In-Reply-To
- <4E005404.5010901@drmicha.warpmail.net>
> Backup now! > I guess you've done that meanwhile anyways, but it's important before > any recovery attempts.
Yes, I've done that.
> Is your reflog OK, i.e. do you get proper output from "git reflog" or > "git log -g"?
No. Before moving the corrupted object git reflog would return: fatal: object 0a83757505387aacc2fd36b3c996729e6bf9d6e5 is corrupted
and after moving the file it would say: fatal: bad object HEAD
> .git/objects/0a83... probably
Yes, it was a typo.
Show 5 quoted lines
> The reflog will give you the previous value of HEAD. You can set > refs/heads/master to that (git update-ref) and then rebuild the lost > commit on top of that (assuming only one commit is lost). The dangling > trees are not necessarily due to the corrupt commit object. Have you > changed any files since the corrupt commit?
Yes, I've changed two files after the last commit (I knew about the corruption when I was just about to commit the changes).
> Do you remember which files > you changed in that commit? > > Michael
If the the corrupt commit is the last one, yes.
Thanks.
-- Kasra