0

So, I recently migrated our git servers and during the migration I think some objects got left off in the old repo. This was a couple of weeks ago and today I tried to run git gc --aggressive on the repo in the new server but it failed with the below error:

error: Could not read a23bacz
fatal: bad tree object a23bacz
error: failed to run repack

Then, I went to my old repo and tried to grab that object by following: Git: fetch a specific object from a remote

i.e. I ran git cat-file tree a23bacz > 3b... and then I copied that object to the repo on my new server. However now, I get the below error:

fatal: loose object a23bacz (stored in 
./objects/a2/3bacz) is corrupt

I also ran git fsck:

git fsck
broken link from  tree 1a4da9z
            to    tree a23bacz

Is there any way to fix this?

Jason
  • 2,246
  • 6
  • 34
  • 53
  • Does this answer your question? [Git: "Corrupt loose object"](https://stackoverflow.com/questions/4254389/git-corrupt-loose-object) – kabanus Aug 09 '20 at 05:24
  • Yeah but there is some things different. I tried follow Linus's suggestion from https://github.com/git/git/blob/master/Documentation/howto/recover-corrupted-blob-object.txt but for me `git ls-tree 2d9263c6d23595e7cb2a21e5ebbb53655278dff8 ` gives me the folder name rather than filename (my-magic-file). The folder name, I think is the first two letters of commit_hash. – Jason Aug 09 '20 at 06:45

0 Answers0