Re: How to replace a single corrupt, packed object?
From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:45:07
Johannes Schindelin [off-list ref] wrote:
On Fri, 8 Aug 2008, Johannes Schindelin wrote:quoted
On Fri, 8 Aug 2008, Shawn O. Pearce wrote:quoted
Johannes Schindelin [off-list ref] wrote:quoted
my auto gc kicked in, and shows this: fatal: corrupt packed object for 2c1e128aa51e3a64bd61556c0cd488628b423ccf error: failed to run repack
Here's another idea. You have the good object loose. So do something like this: $ mkdir foo $ cd foo $ git init $ cp ../../the_good_loose_obj .git/objects/??/.... $ cd ../corrupt_repo $ ( cd ../foo; echo blob; echo data $(git cat-file -s the_good_loose_obj); git cat-file blob the_good_loose_obj; ) | git fast-import $ git repack -a -d The new pack file created by gfi will have a newer timestamp than the one with the corruption. This will cause it to sort higher in the pack list, and we'll take objects from the first pack we find it in. -- Shawn.