Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Repository is growing instead of shrinking

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
count: 0
size: 0 bytes
in-pack: 17448
packs: 1
size-pack: 685.47 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

What do I need to do to get the repo to shrink on bitbucket?

2 answers

1 accepted

0 votes
Answer accepted

Hi @psyon,

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:

Kind regards,

I had a similar issue and ended up raising a ticket to support which got resolved very quickly.

Suggest an answer

Log in or Sign up to answer
Site Admin

Atlassian Community Events