We have a central git repo, that started to tell us after every push
, that it can’t do gc. When connection to it with SSH, and trying to run gc we get:
$ git gc
fatal: bad tree object 7561107eb53a58dc907f0cc8dac75f18ccecd3ae
fatal: failed to run repack
But we can’t find this object, nor nothing that points to it.
We know it doesn’t exist because:
git cat-file --batch-check --batch-all-objects --unordered | grep 7561107eb53a58dc907f0cc8dac75f18ccecd3ae
returns nothing- fsck command (
git fsck --unreachable
or--dangling
or--lost-found
, or--full
) returns nothing with it - also this:
git fsck 7561107eb53a58dc907f0cc8dac75f18ccecd3ae
>>... error: 7561107eb53a58dc907f0cc8dac75f18ccecd3ae: object missing
- and this
git cat-file -p 7561107eb53a58dc907f0cc8dac75f18ccecd3ae
>>fatal: Not a valid object name 7561107eb53a58dc907f0cc8dac75f18ccecd3ae
We know that no-one points to it, because when iterating all the objs and inspecting their content (to find which one points to it) with git cat-file --batch --batch-all-objects --unordered | grep 7561107eb53a58dc907f0cc8dac75f18ccecd3ae
we get empty results.
But still we get error on each git gc
. How can we find the culprit?