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

Replacing a corrupt blob

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Nov 9, 2010, 17:02 UTC
Message-ID
<4CD97E90.5010906@workspacewhiz.com>

I just helped someone fix a repository where a blob became corrupted a while back when passing through Dropbox. No backup of the original blob existed.

The user told me the contents of the blob was unimportant.

Thinking I could be clever, I ran 'git replace' to replace the blob with something else. I thought I could run 'git clone' or 'git filter-branch' to apply it permanently, but that didn't seem to work.

In the end, I ran 'git fast-export', changed the blob SHA, and then ran 'git fast-import'. 'git fsck' still told me the blob was corrupt, and I couldn't determine the sequence of commands to make it clear out the bad blob (expire the reflog, prune, etc).

I was able to 'git clone' to another location, and the bad blob was gone.
Is there another way to permanently replace a corrupt blob?

What is the right way to remove the corrupt blob without running 'git clone'?

Thanks!
Josh
Message 1 of 1 in “Replacing a corrupt blob”
  1. Joshua JensenNov 9, 2010

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.