1) Problem Description
I have several pack files saying unknown object type 0 at offset, and unlike 99% of posts on the web this isn't a local problem but appears in both remote and cloned repos.
2) What I want to do
How do I simply remove those invalid references so that I'm not blocked from doing other operations on the repo? Ultimately, I want to run a git filter-branch --subdirectory command to split my 9.2G repo into submodules, but it chokes on these invalid pack files (note: index-filter works).
3) Full error message
$ git filter-branch --subdirectory-filter mydir HEAD
error: unknown object type 0 at offset 78171701 in /media/me/unmirrored/trash/git_filter_subdir_attempt.2020-06-21/me.git.cloned/.git/objects/pack/pack-35b37571b163f30d71a98002a7f6a30aaeeadbad.pack
fatal: packed object a30f803926d5e369b0bda4982dba89fa7127cabe (stored in /media/me/unmirrored/trash/git_filter_subdir_attempt.2020-06-21/me.git.cloned/.git/objects/pack/pack-35b37571b163f30d71a98002a7f6a30aaeeadbad.pack) is corrupt
Could not get the commits
I've also put the git fsck --full output here: https://pastebin.com/WCnArrCh
4) What I've tried
fetch again
Most solutions assume you have an uncorrupted remote copy. But all my copies are corrupt.
Delete the reference
(I will add the unsuccessful outcome response after reproducing)
git update-ref -d abc123
(https://git.wiki.kernel.org/index.php/GitFaq#salvage)
git-repair
(I will add the unsuccessful outcome response after reproducing)
git-repair
git-repair --force
(http://manpages.ubuntu.com/manpages/bionic/man1/git-repair.1.html)