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

[announce] git-repair

From
Joey Hess <joey@kitenet.net>
Date
Nov 18, 2013, 18:13 UTC
Message-ID
<20131118181350.GA28776@kitenet.net>
I've created git-repair as a small spinoff from git-annex.
http://git-repair.branchable.com/

git-repair is a complement to git fsck, which only finds problems, but does not try to fix them.

At its simplest, git-repair deletes all corrupt objects and corrupt packs, makes a fresh clone from a remote[1] and rsyncs the missing objects back into the repository.

If that is not sufficient to fully recover the repository, it can also reset branches back to commits before the corruption happened, delete branches that are no longer available due to the lost data, and remove any missing files from the index. It will only do this if run with the --force option, since that rewrites history and throws out missing data.

I would be very sad to have to use git-repair --force on a git repository holding source code, although it might manage to preserve commits that I had forgotten to push. It's more likely to be useful in a git repository being used for non-source-code purposes, where the loss of some files won't break the build of a program.

[1] It would be more efficient if it could git fetch individual missing
    objects from the remote, but my current understanding is that the
    git protocols do not allow doing that.
-- 
see shy jo
Message 1 of 1 in “[announce] git-repair”
  1. Joey HessNov 18, 2013

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.