git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 11 in “corrupted Git repository”
  1. Kasra KhosoussiJun 21, 2011
  2. Michael J GruberJun 21, 2011
  3. Kasra KhosoussiJun 21, 2011
  4. Michael J GruberJun 21, 2011
  5. Kasra KhosoussiJun 21, 2011
  6. Ilari LiusvaaraJun 21, 2011
  7. Kasra KhosoussiJun 21, 2011
  8. Johannes SixtJun 21, 2011
  9. Kasra KhosoussiJun 21, 2011
  10. Carlos Martín NietoJun 21, 2011
  11. Kasra KhosoussiJun 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.