Repository size exceeds limit
Asked by fabio_carvalho:

Dear all,

Our current repository just exceeded the 4GB size limit. We have already tried to remove last commit that exceeded the 4GB limits but nothing happened.

We have also enabled the "Delete dangling commits when over size limite" as suggested in this link below:

<https://jira.atlassian.com/browse/BCLOUD-11593>

But at this moment the size hasn't decreased. Can you please run GC and help us out?

We are also planning to delete old branches since we have many, will it require GC to run one more time? How often does the GC runs?

\*\*Please let me know if you need any further information. Currently all my developers cannot push any code to our repository and I cannot take any action.\*\*

Thanks in advance


Answers:
author: Theodora Boudale
body: Hi [@fabio_carvalho](/t5/user/viewprofilepage/user-id/5075963), welcome to the community, and thank you for tagging me in this (it's perfectly fine).

I ran a git gc on the repository that was over the 4 GB limit and its size has been reduced, so your developers should be able to push now.

The repo's size is still quite large, so I would suggest reducing it further, if possible. You can check this post of mine in a different question with more details:

* <https://community.atlassian.com/t5/Bitbucket-questions/Revert-bitbucket-repository-state-to-one-day-prior/qaq-p/1908360#M76762>

If you decide to proceed with the steps mentioned in that post and rewrite history in the repo with BFG, please keep in mind that the repo's size will get increased again once you push your changes. The repo will then need another git gc for the old commits (prior to history rewrite) to get removed and to get its size reduced.

If you decide to delete branches, a git gc will be required as well. A git gc runs every after push, but with different arguments depending on many different conditions.

You can either let me know here, and I can run another git gc for the repo, or alternatively, since the repo belongs to a workspace on a paid billing plan, you can create a ticket with Bitbucket Cloud support team. You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. If the repo is over the size limit and your team is blocked, please create the ticket with priority "Level 1" to ensure a faster response.

We have a feature request to allow users to trigger a git gc on their remote repositories: <https://jira.atlassian.com/browse/BCLOUD-11593>

Please feel free to let me know if you have any questions or if you need anything further.

Kind regards,  
Theodora

comments: author: fabio_carvalho
body: Thank you very much [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) . The repository size decreased and we can work on it again. We will make a plan to decrease its size even more and in case I need GC execution I will follow your suggestions.

I really appreciate you support and your complete answer.

Best Regards,

Fabio


author: Theodora Boudale
body: You are very welcome Fabio, I'm glad to have helped.

Please feel free to reach out if you ever need anything else.

Kind regards,  
Theodora


author: fabio_carvalho
body: Dear [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , can you please run GC one more time please? I am doing some changes to release more space to our repository. I deleted several branches we were not using and our repository size should decrease.

I still have some doubts how bitbucket (git) handles when we delete a file. For example, I have some files on our repository that sums 330MB and in fact I don't need to keep them in the repository. I am planning to delete these files but I am not sure if it will release much space since git probably keeps it for tracking purposes. Can you tell me if deleting these files will really fully delete it and free space from our repository? Or will it free only a small part of the space related to these files and most of the space will still be ocupied for tracking purposes? Not sure if I made myself clear on this matter.

Please let me know if you were able to run GC. If you prefer, I can open a new question in the community since this one was already solved / accepted.

Have a great day.


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

Apologies for the delay, I missed some notifications. I am not sure which was the repo I ran a git gc for last time. I checked the repositories you have access to, and I ran a git gc on the one with a size of 3.9 GB. Its size has been reduced, but only a little bit.

In case you wanted the git gc on a different repo, please let me know the last two letters of the repo so I can identify it and run a git gc for it.
> Can you tell me if deleting these files will really fully delete it and free space from our repository?

If you delete the files from your local clone and then commit the file deletions, this will not remove the files from the repo's history. As you mentioned, the files are already tracked by Git and they will continue to exist in earlier commits. I don't think this will affect the repo's size much.

The only way to remove completely the files from the repo's history (from all commits) is by rewriting the Git history, please check the question I linked earlier and feel free to let me know if you have any questions: <https://community.atlassian.com/t5/Bitbucket-questions/Revert-bitbucket-repository-state-to-one-day-prior/qaq-p/1908360#M76762>

Kind regards,  
Theodora


author: fabio_carvalho
body: Thank you very much [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) .

You ran the GC on the correct repository.

I will check the reference you sent me related to removing files from the repo's history and I will try to take some action.

Best regards,

Fabio


author: fabio_carvalho
body: Dear [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

Can you please run the GC one more time. We are having the same issue as before when you helped us.

We just exceeded the 4GB in the repo and we can't delete/push anything.

Please send me a message when the GC is executed and I will check if we can work again. Currently our development team can't take any actions.

Best Regards,


author: Theodora Boudale
body: Hi Fabio,

Apologies for the late reply, I was out of office.

I see that you created a support ticket as well and you are getting assistance there.

For a workspace on a paid plan, you can always create a support ticket if the issue is a blocker for you to ensure a faster response. For a workspace on the free plan, I would suggest creating a new community question, which will be visible to the rest of my team in case I'm out of office.

Kind regards,  
Theodora


author: fabio_carvalho
body: Dear [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) , I created a support ticket last week and I am getting a closer support at this moment.

Thanks for your message !!

Best Regards,

Fabio


author: fabio_carvalho
body: [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) sorry to tag you in this support. But I have seen you resolved similar issues by running the GC. Can you please help my team? We are currently waiting for it.


Tags: bitbucket-cloud

cloud

repository

size