Re: How to recovery a corrupted git repo
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:50:37
Ping Yin [off-list ref] 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/