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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Repository > 2GB, can't push anymore

Our repository grew up beyond 2GB.

I cleaned up the local repo, and followed up the steps to reduce the repo size, but it just got locked, so I can't push any change.

Can you help me?

2 answers

1 accepted

0 votes
Answer accepted

Hi Franco,

When a repo goes over 2GB and you switch to the commit before the bad one, a git gc is needed on the remote repo. This should run automatically if you have enabled the Lab feature Delete dangling commits when over size limit. I can see this is not enabled for your Bitbucket account, so I believe this is why the git gc did not get triggered.

I checked your account in our system and found which repo is more than 2 GB from the ones you have access to, and ran a git gc on it. Its size is now 1.3 GB so you and your team should be able to push.

Now, for reducing the repo's size, removing a file with git rm will not remove it from the repo's history.

If you have any files/folders in the repo that do not need to be versioned, you can remove them either with git filter-branch or with a tool like BFG

Afterwards, you can check the size of your local repo with

git count-objects -Hv

It will be the sum of the fields size and size-pack in the output. If you're ok with the new size, you can push that to Bitbucket. Please note that when you do this the repo size will go up again. Don't be alarmed, this is expected because the remote repo will contain both old and new refs. Another git gc will be needed on the remote repo to have the old refs removed, and its size should then go down.

If you push history rewrite, the git gc won't get triggered automatically, so I would suggest opening a ticket with the support team right after to request a git gc for that specific repo. You can do so via the following link:

In "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. In "What is the impact to your business?" make sure to select "Level 1" if the repo is over 2 GB and your team is blocked from working, to ensure you get a timely response.

If you have any questions, please feel free to let me know.

Kind regards,

Thank you very much for everything

You are very welcome, glad to have helped.

Can you please go into more detail what steps you followed to reduce the repo size?

(I wish I could comment the question, as this isn't really an answer...)

Thank you for answering.

When the repo was blocked, I switched to the commit before the bad commit and pushed (as the oficial guide says).

Then, I deleted the Pods/ folder (iOS repo, an old and bad decision), ran git gc --aggresive, git rm -rf Pods/, even ran filter-branch.

But it doesn't seems to like it, because I couldn't push.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

Share your use cases: How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features to how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your tea...

36 views 0 1
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you