I try to reduce my repo size and push it into a remote new-remote
. What I tried is
- create a new branch by
git checkout --orphan clean
git rm --cached
to clean those large file- further cleaning ref by
git reflog expire --expire=now --all
followed bygit gc --aggresive --prune=now
.
I was hoping that in this way I only need to remove the large file in the HEAD since there's no history contained for this branch.However, after I did git push
, I found the compressing object
reduced but counting object
remain the same. Could I know why this is the case, and which is a better indicator of whether the new-remote
would have a shrinked repo ? Would git filter-branch
be needed in my case ?