Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Repository is growing instead of shrinking

psyon
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2022

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
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 9, 2022

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: https://jira.atlassian.com/browse/BCLOUD-11593

Kind regards,
Theodora

0 votes
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2022

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
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events