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

Re: Recover broken git repository?

From
SHStefan-W. Hahn <stefan.hahn@s-hahn.de>
Date
Jul 14, 2009, 17:52 UTC
Message-ID
<20090714175245.GD9919@scotty.home>
In-Reply-To
<alpine.LFD.2.01.0907141019380.13838@localhost.localdomain>
Also sprach Linus Torvalds am Tue, 14 Jul 2009 at 10:33:58 -0700:
Hi,
> > $ git commit -m "Some message"
> > error: invalid object 1086b1c606a04bcb78b92d1d411a299d20d18034
> > fatal: Error building trees

I've trapped in a similar problem few days ago on windows using cygwin.

A simple "git status" told me an invalid object. Just doing git status corrupted the index file and only this. The reason was a wrong configured (unseen reconfigured from another script) mount via cygwin using "textmode" not "binary mode".

After remounting with "binary mode" a simple "git read-tree HEAD" repaired it. Just the index file had been corrupted.

Stefan
-- 
Stefan-W. Hahn                          It is easy to make things.
/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.			

Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
Bundesgesetzblatt:
http://www.bgblportal.de/BGBL/bgbl1f/bgbl107s3198.pdf
Previous: Stefan-W. HahnNext: Linus Torvalds
Message 7 of 9 in “Recover broken git repository?”
  1. Florian BreitwieserJul 14, 2009
  2. Alex RiesenJul 14, 2009
  3. Nicolas SebrechtJul 14, 2009
  4. Jakub NarebskiJul 14, 2009
  5. Linus TorvaldsJul 14, 2009
  6. Stefan-W. HahnJul 14, 2009
  7. Stefan-W. HahnJul 14, 2009
  8. Improve on the 'invalid object' error message at commit timeLinus Torvalds, Jul 14, 2009
  9. Junio C HamanoJul 14, 2009

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.