Repo size exceeds 4GB, cant push fixes
Asked by kelkk:

Hello,

I was recently at 3.2GB on my repo and attempted to do some cleaning up to avoid running into the 4GB limit. But doing so somehow resulted in the repo going up to 4.7GB instead of down to 1.5GB which I have locally...  

I tried fixing it with BFG, but I can't push those fixes because the repo is beyond 4GB, so it is stuck and there is now nothing I can do.

Please help.


Answers:
author: kelkk
body: For future googlers:  

Support had to fix this on their end by running some GC on the bitbucket remote, there was nothing I could do, but they were fast so that's good.

comments: author: Bastien Chong
body: Thank you, I faced the same issue. For some reason, the BFG cleanup works very well, but a manual GC is needed on Bitbucket cloud to show to the new real size.  
Open a ticket, they will take care of this for you !


author: Theodora Boudale
body: Hi [@kelkk](/t5/user/viewprofilepage/user-id/4692809) and welcome to the community.

Your Bitbucket Cloud account with the same email as your community account owns one repo over 4 GB. I ran a git gc for this repo, but its size has not been reduced.

Since you have reduced the size of your repo locally with BFG, I temporarily increased the repo size limit to 6.5 GB so you can push your changes.

Please note that when you push your changes, another git gc will be needed on the remote repo, for the repo's size to decrease. Feel free to leave a comment here to let me know that you have pushed, and I can run another git gc for your repo.

Kind regards,  
Theodora

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

Great, I managed to push now.  

To print local size I use:

```
git gc
git count-objects -vH
```

Output is:

```
$ git count-objects -vH
+count: 0
size: 0 bytes
in-pack: 5366
packs: 1
size-pack: 1.11 GiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

```

If you agree that this is an accurate way of measuring a git repo size, it should consume just 1.11GiB as it is now.

It says 5.8GB on bitbucket though, but let's see what happens if you run another gc then.


author: Theodora Boudale
body: Hi [@kelkk](/t5/user/viewprofilepage/user-id/4692809)

Thank you for the update.

I ran another git gc for your repo, but its size remains unchanged.

I have created a ticket for this issue with Bitbucket Cloud support team, you should have received an email with a link to the ticket. (In case you haven't, please feel free to let me know, I can post the ticket URL here, only you and Atlassian staff will be able to view its content).

The engineer that will work on your ticket will provide an update there.

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

Kind regards,  
Theodora


author: Kurt Klinner
body: [@kelkk](/t5/user/viewprofilepage/user-id/4692809)

Welcome to the Atlassian community

Have you had already a look to <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/>

Cheers

Kurt

comments: author: kelkk
body: Hi Kurt, thanks,

Yes, but that page only suggests to reverse the last commit if above 4GB, but that only works if the problem is a large last commit. In this case the last registered commit was a few days ago and only caused the repo to be at 3.2GB.  
The problem here is that I attempted to remove a file from history to reduce the repo size below 2GB, but that somehow caused the remote repo on bitbucket to grow beyond 4GB even though it takes 1.5GB locally... Probably due to storing garbage remotely, but garbage collection on the bitbucket remote doesn't seem to work either, I tried that function as well. I also tried the hack to trigger remote gc by creating and deleting a branch on bitbucket, but it triggered no change.

My first attempt was with filter-branch, and I tried to do a more proper cleanup a second time by using BFG, but i can't push those changes due to the 4GB limit...


Tags: bitbucket-cloud

cloud