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

Re: How to recovery a corrupted git repo

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Feb 21, 2011, 15:31 UTC
Message-ID
<vpqipwds8uh.fsf@bauges.imag.fr>
In-Reply-To
<AANLkTim-O+LR_r=N6y7Dcip8xQGcBVP2FiVhu22Zhysf@mail.gmail.com>
Ping Yin <pkufranky@gmail.com> writes:
> Thanks. This should be an applicable method. However, before rsyncing,
> the pack should be unpacked first.
No need. Just copying the pack files works too, and is way faster:

/tmp/corrupted$ git fsck missing commit 4815c2955d5863005edc4ff61c0de42e9609a920 dangling tree c8b826f673e1f1edb0fb5dc58294148be06cd6cb /tmp/corrupted$ cp ../cloned/.git/objects/pack/pack-e34444a471a9cd3e6f2656b609ffa0d66cce1f9c.* .git/objects/pack/ /tmp/corrupted$ git fsck /tmp/corrupted$ git gc Counting objects: 12, done. Delta compression using up to 2 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (12/12), done. Total 12 (delta 0), reused 12 (delta 0)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ping YinNext: Ping Yin
Message 7 of 8 in “How to recovery a corrupted git repo”
  1. Ping YinFeb 21, 2011
  2. Christian CouderFeb 21, 2011
  3. Axel FreynFeb 21, 2011
  4. Ping YinFeb 21, 2011
  5. Matthieu MoyFeb 21, 2011
  6. Ping YinFeb 21, 2011
  7. Matthieu MoyFeb 21, 2011
  8. Ping YinFeb 22, 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.