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

Not able to push even after reducing the repo size to less than 4GB


Dear Team,

Seeing this below error and with help of  BFG Tool, we reduced the size to less than 4GB and still we are not able to push. Kindly help us with the issue .

Repository size exceeds limit

This repository is over the 4 GB limit and your contributors are not able to push new commits. To resolve this, reduce the repository size.
Error Message when commiting


# git push origin master --force
Password for '<url removed>':
Counting objects: 37664, done.
Delta compression using up to 6 threads.
Compressing objects: 100% (19342/19342), done.
Writing objects: 100% (37435/37435), 666.10 MiB | 22.23 MiB/s, done.
Total 37435 (delta 23393), reused 31633 (delta 18032)
remote: Resolving deltas: 100% (23393/23393), completed with 144 local objects.
remote: Checking connectivity: 36064, done.
remote: Repository is over the size limit (4 GB) and will not accept further additions.
remote: Learn how to reduce your repository size:
<url removed>
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 
<url removed>



2 answers

1 accepted

1 vote
Answer accepted

Hi Lalith,

Since you have already reduced your repo size locally with BFG, I went ahead and temporarily increased the repo size limit, so you can push your changes.

After you do, the repo's size will get increased again, because the Bitbucket repo will contain both old refs (prior to history rewrite) and the new ones. Please feel free to let me know after you make this push, and I can then run a git gc so that the old refs get removed, and the remote repo's size should get reduced.

Just to give you some context on why the automated git gc did not run for your repo:

When a repo is over the size limit, the only thing that can be pushed is a git reset that undoes the latest large commits, you can find more details in our documentation here:

If you enable the Labs feature Delete dangling commits when over size limit and follow the steps on this guide, a git gc should get triggered for the repo automatically. The git gc will not get triggered if you push anything else, like history rewrite with BFG.

Just a heads up, I removed the repo url from your post to protect your privacy.

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

Kind regards,

Hi Theodora , 

Thanks much for the detailed and clear explanation of the scenario. 

We have pushed successfully now , Kindly help us with running gc. 

Also the repo quota we had is 4GB and now it shows 2GB , Will our Repo Quota remain as 4GB ? 

Thank you for the support


Hi Lalith,

I ran a git gc for the repo, its size is 2 GB now. Does this agree with the size of your local repo?

You can check that by running

git count-objects -Hv

in the local mirror clone where you executed BFG, the repo's size should be the sum of the fields size and size-pack.

The repo size limit should be 4 GB at the moment as I removed the higher limit that I previously set in order for you to push. I'm not sure if the limit was showing different to you because of the temporary change I made.

Do you still see a different limit now and are you able to push to the repo?

Kind regards,

Wow, Awesome! Thanks a lot Theodora. In my local the repo size was around ~1.5GB though. The warning messages are gone now! Will try pushing with our changes.  

Quite detailed and informative response provided. Thanks again for unblocking us.


Wierdly , the size of repo increased to 6.83GB from 4.03GB even without any commits. Can Atlassian Team help please ?

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,265 views 2 9
Read article

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