I am trying to cleanup my repository and remove everything unreachable.
I did
git reflog expire --expire=now --all
git fsck --full --unreachable
git repack -A -d
git gc --aggressive --prune=now
But I still have some commits that are unreachable from my understanding but not by git's
I have some commit, let's say A
git branch --all --contains A
git tag --contains A
return nothing
but
git fsck --full --unreachable
also returns nothing so it does not consider A as an unreachable.
What am I missing?
Actually, I found it!
That is refs/original/mybranch ref that still keep my commit reachable.
These original refs are created during git filter-branch
git branch --all
does not include them.
The reason why I did not find them at the beginning because they were missing in .git/refs/original folder.
I found them in .git/packed-refs file. I just removed those branches from that file and cleaned repository again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With