Repository size exceeds limit
Asked by safaa:

This repository is over the 2.0 GB limit and your contributors are not able to push new commits. To resolve this, reduce the repository size.Cant commit further. Can any please let me know How Can I reduce repository size ?? or any alternatives to reduce the size


Answers:
author: Theodora Boudale
body: Hi Safaa,

If you can let me know the URL of this repo, I can run a git gc on it. This may be enough to reduce the repository size.

There are many things that contribute to the repo's size, like the size of the files in the repo, the size of diffs, the number of commits.

If the repo contains large files, and its size remains large after a git gc, a way to reduce its size would be to:

* either remove from the repo's history large files that do not need to be versioned
* or, if there are large files that do need to be versioned, move them to Git LFS

I would suggest that we run a git gc first, as this may be enough. If not, then we can discuss next steps.

In case you don't feel comfortable sharing the repo URL here publicly, you can open a ticket with the support team via <https://support.atlassian.com/contact/#/>. In "What can we help you with?" select "Technical issues and bugs" and then select Bitbucket Cloud as product. Make sure to mention the URL of the repo that is over the size limit.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora

comments: author: safaa
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

The url of the repos is: https://SafaaKhalaf@bitbucket.org/digitalnoir/weber-kitchen-builder-ios.git

I have already deleted some branches to get the size smaller but that didn't make any change. So maybe after running git gc the repo size would reduce.

Thanks in advance.


author: Theodora Boudale
body: Hi [@safaa](/t5/user/viewprofilepage/user-id/4109135) ,

Thank you for your reply. I went ahead and ran a git gc on this repo, its size is 926.1 MB now. This is below the 2 GB limit so you shouldn't have any issues pushing. It's still quite large though, so I would recommend reducing the size further, if possible.

Do you have any large files in the repo that you don't need to version? Or do you version any large files, that could be moved to Git LFS?

Kind regards,  
Theodora


author: Itamar Silva
body: Hi [@Theodora Boudale,](https://community.atlassian.com/t5/user/viewprofilepage/user-id/818086)   
I'm facing the same issue.   
Can you help me?  

Repo: <https://bitbucket.org/backendpag/pag-ios>  

Thanks

comments: author: Theodora Boudale
body: Hi [@Itamar Silva](/t5/user/viewprofilepage/user-id/4199448) , I replied to the question you created as well, I ran a git gc for the repo and its size has been reduced. Please feel free to let me know if you need anything further.


author: Itamar Silva
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)  
It's working, thanks


author: GagandeepSingh1
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) We are facing the same issue. Here is our repository URL:

git@bitbucket.org:ArteriorHome/arteriors_m2.git

Please help me remove of arteriors_in, media, pub, genrated@@ folders and sql files from root directory.  
can you please add .jpg, .jpeg and .png in .gitignore file.  
we followed your link to undoing all changes but unable to do so, When we are trying to push the code it again through an same error you can not push the code.  

Please help to remove that exceed message from repository.  

Thanks  
Gagandeep

comments: author: Theodora Boudale
body: Hi [@GagandeepSingh1](/t5/user/viewprofilepage/user-id/4164011) ,

I have run another git gc on the repo, but its size remains above the 2 GB hard limit.

I have opened a ticket for you with the support team which you can find here:

* <https://getsupport.atlassian.com/servicedesk/customer/portal/11/BBS-151779>

The support team can give you guidance in this ticket on how to reduce the repo size and how to have this limitation removed.

Kind regards,  
Theodora


author: GagandeepSingh1
body: HI [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)   
Thank you for your help. I will check.  
Regards,  
Gagandeep


author: Raj Dhiman
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) I am facing the same issue. Can you please help. Here is my repository URL:

git@bitbucket.org:ArteriorHome/arteriors_m2.git

Please help me remove of .SQL files from root directory.

comments: author: Theodora Boudale
body: Hi Raj,

I ran a git gc on this repository, its size went down to 344.5 MB. You and your team should be able to push to the repo again.

If you would still like to remove .SQL files from the repo's history, you can do so either by using BFG tool, or by using git filter-branch. There are detailed instructions on how to do this in the following documentation:

* <https://support.atlassian.com/bitbucket-cloud/docs/maintain-a-git-repository/>

I would suggest reading all info in that page in order to understand how the process of rewriting history and file removal works. If you want to try it, I would also suggest that you first create a fork of the repo and test it there, before doing this in the repo everyone is working on.

If you rewrite history and push to the Bitbucket repo, its size will go up. Please don't be alarmed, another git gc will be needed to remove the references that were deleted and for the repo's size to go down. Feel free to let me know when you make the push or open a support ticket, and we can run another git gc on the repo.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


author: Raj Dhiman
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , Can you please perform the above operation again. as the repository size is again exceeded.

And please help us remove with the following file and update the .gitignore file:

remove all .SQL file from the branch and mention them into .gitignore

Mention the .jpg, .jpeg and .png not to be synchornized.

Thanks In advance.


author: Theodora Boudale
body: Hi [@Raj Dhiman](/t5/user/viewprofilepage/user-id/2416669) ,

I ran another git gc on the repository, however its size is still 4.3 GB.

One thing you can do, is follow the steps in the following documentation (title "**Undoing the last push**") to remove the read-only limitation from the repo:

* <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Reducerepositorysize-Undoingthelastpush>

If you face any issues during the process or if the git gc doesn't run automatically when you rewind the branch and push your changes, I would suggest opening a support ticket via <https://support.atlassian.com/contact/> to request further assistance. In the field "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 your team cannot work because of this.

It is not a problem at all to post here, however, considering that this issue is a blocker for you, you will get faster responses from the support team for a "Level 1" issue.

I'm afraid that we cannot remove any files from repo's history from our side, but the support team will be able to guide you on how to do this.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud