I'm trying to solve a repository size limit issue on a repository hosted on Bitbucket, where I have reached the 2GB repository size and can no longer push new commits into.
At one point in time, this repository became very big due to the nature of the files in it (Many textures and sound files that were needed as part of the Unity project this repo is for), and our solution at the time was to create a submodule to place all assets into while keeping the core project in the main repo.
This worked for a while, but now I have reached the limit again on the main repo, and digging into it (Thanks to the script provided in this answer: How to find out which files take up the most space in git repo?), I found out that the reason for this was that all of the files that we have moved to the submodule still have their history intact in the main repo.
I then found out about The BFG (https://rtyley.github.io/bfg-repo-cleaner/) that I could use to rewrite the history of my repo and remove the large entries in it by using bfg --delete-folders
, then running git gc
as instructed in the Usage segment of The BFG page.
Running git count-objects -v
afterwards seems to suggest that this had worked, with my repo dropping from a 1.9gb size-pack to under 300mb.
And running the script linked above that finds the heaviest entries in the repo no longer finds any of the problem files that were moved to the submodule.
My problem is that despite all that, when I try to push the cleaned repo back to Bitbucket, it fails under the same claim that the repo had exceeded the 2GB size limit and can no longer accept any pushes. If it can't accept the push that's supposed to clean it up, then how exactly am I expected to do that? Any ideas what I'm missing?
Thanks
You might delete all its branches on github and then push the new branches.... or you might delete the repo as a whole on github, recreate it from scratch and push the new branches.