I had an iOS repo on bitbucket and reached a limit of 4Gb. The repo started to deny any commits.
I decided to remove Pods folder using one of these instructions:
Remove folder and its contents from git/GitHub's history
https://stellarflavor.com/2021/12/25/how-to-remove-pushed-pods-folder-from-git-repository/
The repo denied "force push" even if it reduces the repo size so I decided to drop all existing commits to the initial one which contains one small file (.gitignore).
The problem is I reduced repo size to acceptable limit but the .git folder is still huge (more than 99% of whole repo size even when git history is fully dropped). Why does it happen and how to fix it?
git gc [--aggressive], doc here)git gcon your system won't affect Bitbucket's copy. If Bitbucket is rejecting new pushes because their copy of the repo is too large, then you need to talk to them.pushso I cloned this repo into another folder and performed some "force push" commands to clean everything but initial commit. Then I switched back to the local repo with deleted Pods folder and performed "force push" again. Currently it works but this "git garbage" still wastes free local and remote disk space.