Size of repo increased instead of reduce
Asked by Andres Vargas Gonzalez:

Hello,

I tried reducing the repo size. However, the current repo went from 2.4 Gb to 3.3 Gb. Could you please help me running a git gc.

Workspace -\> https://bitbucket.org/\<redacted\>

Thanks, Andres


Answers:
author: Patrik S
body: Hello [@Andres Vargas Gonzalez](/t5/user/viewprofilepage/user-id/5430057) and welcome to the Community!

I was able to identify the repository in question based on the workspace you shared, and I manually triggered an aggressive garbage collection which managed to reduce it's size back to 1.5GB.

Now that GC is completed, I would highly recommend you having everyone on your team removing their old copies of the repository and doing a fresh clone of it. Since the old clones have a dirty history, it's better to delete them, so you don't risk pushing the dangling objects back into your cleaned repository, which would increase its size again.

Also, the size you see in a local clone may be different that the remote size you see in bitbucket, because bitbucket also has to store references to the open pull requests. You can find more details on that in the following article :

* [Repository size remains the same after deleting large files and running garbage collection (GC) on the remote](https://confluence.atlassian.com/display/BBKB/Repository+size+remains+the+same+after+deleting+large+files+and+running+garbage+collection+%28GC%29+on+the+remote)

Thank you, [@Andres Vargas Gonzalez](/t5/user/viewprofilepage/user-id/5430057) !

Patrik S

comments: author: Andres Vargas Gonzalez
body: Hello Patrik,

Thank you for the warm welcome and the help provided.

I see the repo size updated to 1.5Gb. I will be doing some more cleaning on this repo and another repo I have. Is there anyway I can submit a request for future iterations. I have another repo in a different workspace that will perhaps pass the 4Gb if it accumulates space after cleaning.

The other repo is more critical as we use it daily.

Is this the best way to communicate these issues ?

Thanks, Andres


author: Patrik S
body: Hello [@Andres Vargas Gonzalez](/t5/user/viewprofilepage/user-id/5430057) ,

I see you have access to a workspace with an active Bitbucket subscription, so you are entitled for Standard support. This means you can raise a support ticket with Bitbucket Cloud in the following portal and request a GC for the other repository you are going to do the cleanup :

* <https://support.atlassian.com/contact/>

When creating the support ticket you will be asked to provide the workspace Id. Make sure to provide the workspace ID where you have the active subscription :)

Thank you, [@Andres Vargas Gonzalez](/t5/user/viewprofilepage/user-id/5430057) !

Patrik S


author: Andres Vargas Gonzalez
body: Hello Patrik,

Could you help me with another GC for the same repo you helped me with previously. I will then move the repo to the workspace with Bitbucket subscription.

Thanks in advance, Andres


author: Hariharan Iyer
body: Hi [@Andres Vargas Gonzalez](/t5/user/viewprofilepage/user-id/5430057)

We would not have access to your repository. You can try one of the options mentioned here to reduce the size

<https://stackoverflow.com/questions/1904860/how-to-remove-unreferenced-blobs-from-my-git-repository>

comments: author: Andres Vargas Gonzalez
body: When I clone the repo after using this tool -\> <https://rtyley.github.io/bfg-repo-cleaner/>

The repo is smaller in size. However in bitbucket it shows a size of 3.3 gb instead of 800 Mb as the cloned repo shows.

I am looking at the link you sent too thanks !

Thanks, Andres


author: Hariharan Iyer
body: \> The repo is smaller in size. However in bitbucket it shows a size of 3.3 gb instead of 800 Mb as the cloned repo shows.

Not an expert on git (or how it's implemented in bitbucket), but I think this is expected. Locally in your clone, git won't store each file in different branches fully. It will store compressed versions of changes. OTOH on bitbucket if a file is different in two branches, bitbucket will store both versions of the file in their entirety so you can quickly view both of them on the web UI.


author: Andres Vargas Gonzalez
body: I am cloning a full copy of the Git database of my repository. Before attempting to reduce the size. It was around 2.5 Gb. After attempt to reduce the size the full copy of the git db of my repo is 800 Mb. When downloaded from git is 800 Mb and not 3.3 GB.

I was reading at this -\> <https://github.com/rtyley/bfg-repo-cleaner/issues/68#issuecomment-191117240>

Not sure if that might be the reason.

THanks, Andres


author: Andres Vargas Gonzalez
body: Hariharan thank you ! It got solved on the next thread.


Tags: bitbucket-cloud

cloud