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

Re: corrupt object on git-gc

From
Alex Riesen <raa.lkml@gmail.com>
Date
Nov 9, 2007, 08:10 UTC
Message-ID
<20071109081035.GA2794@steel.home>
In-Reply-To
<6C2C79E72C305246B504CBA17B5500C9029A36A1@mtlexch01.mtl.com>
Yossi Leybovich, Fri, Nov 09, 2007 00:59:47 +0100:
Show 10 quoted lines
> I wonder if someone can help in this error
> I tried to do git-gc and got error on corrupted object. 
> 
> I do the following:
> 
> $ git-gc
> Generating pack...
> Done counting 3037 objects.
> Deltifying 3037 objects...
> error: corrupt loose object '4b9458b3786228369c63936db65827de3cc06200'

It is loose. Nothing uses it in this repository. What do you need to repair it for?

Show 14 quoted lines
> fatal: object 4b9458b3786228369c63936db65827de3cc06200 cannot be read
> error: failed to run repack
> 
> sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib
> $ cd .git/objects/4b/
> 
> sleybo@SLEYBO-LT /w/work/EMC/ib.071030.001/ib/.git/objects/4b
> $ git-fsck-objects.exe 9458b3786228369c63936db65827de3cc06200
> error: corrupt loose object '4b9458b3786228369c63936db65827de3cc06200'
> error: 4b9458b3786228369c63936db65827de3cc06200: object corrupt or
> missing
> error: invalid parameter: expected sha1, got
> '9458b3786228369c63936db65827de3cc06200'
> missing blob 4b9458b3786228369c63936db65827de3cc06200

the directories directly under .git/objects contain the first bytes of sha1, to use filesystem in a more efficient way. git-fsck expects an sha1 (or a reference).

Try running moving the corrupt object (with its *whole* name) some place else and run git-fsck --all.

Previous: Junio C HamanoNext: Yossi Leybovich
Message 7 of 10 in “missing object on git-gc”
  1. Yossi LeybovichNov 8, 2007
  2. Christian CouderNov 8, 2007
  3. corrupt object on git-gcYossi Leybovich, Nov 8, 2007
  4. Christian CouderNov 9, 2007
  5. Yossi LeybovichNov 9, 2007
  6. Junio C HamanoNov 9, 2007
  7. Alex RiesenNov 9, 2007
  8. Yossi LeybovichNov 9, 2007
  9. Andreas EricssonNov 9, 2007
  10. Nicolas PitreNov 9, 2007

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.