Our repository was over 2GB in size due to some video files that were placed in it by accident. I removed them and rewrote the history, and did a push, and bitbucket says the repository got bigger. I did a repack, and got the local file size much smaller, but again, when I tried to push, Bitbucket now reports that the repository is over 4GB. Locally I get this:
$ git count-objects -Hv
size: 0 bytes
size-pack: 685.47 MiB
size-garbage: 0 bytes
What do I need to do to get the repo to shrink on bitbucket?
I checked the repositories your account has access to and I found one over the 4 GB limit. I ran a git gc on it, and its size has been reduced.
If you rewrite history and push it to Bitbucket, the repo's size will go up because the repo will contain both new commits and old ones (prior to history rewrite). A garbage collection is needed to remove the old references and for the repo's size to get reduced. At the moment, this can only be run by the support team.
There is a way for end users to get the garbage collection triggered if the following conditions are met:
Then, the garbage collection will be triggered automatically. This is useful if you accidentally pushed a commit with large files, the repo has gone over the size limit, you haven't merged the large commit to any other branches yet, and you want to undo it.
If your repo's size is below 4 GB after the large push, the above won't work and you need to rewrite history with BFG or git filter-branch and push. You can then contact us to trigger the garbage collection. We have a feature request for allowing users to trigger manually a garbage collection for their repos: https://jira.atlassian.com/browse/BCLOUD-11593