Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Reduce Repo size

Karim Assylbek October 27, 2020

Hello,

I have a problem with my repo. My repository has grown more in size after I trie the BFG Method and it grew even bigger (1.85 GB). A manual git gc would be helpful. I fear if I try this Method again that my repo will go over the 2 GB and wont except my git commands.

2 answers

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2020

Hi Karim,

You are right that when you rewrite history and push to the Bitbucket repo, a git gc is needed on the remote repo for the old references to get removed and for the repo's size to get reduced.

I checked your Bitbucket Cloud account in our system, I found which repo from the ones you have access to has a size of 1.8 GB, and I ran a git gc on it. Its size is now 197.2 MB.

Please feel free to let me know if things are ok now and if you have any further questions.

Kind regards,
Theodora

Karim Assylbek October 28, 2020

Hi,

thanks for the git gc! This is the second time this happend to my repository. I'm not sure if this is an error from my side or from GitBash/repository. Is there a way to verify it?

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 2, 2020

Hi Karim,

You are very welcome!

If the repo size increased after a push that included history rewrite, this is expected. In this case, the remote repo contains both old references (prior to history rewrite) and the new ones, which is why its size gets increased. A git gc is needed on the remote repo for the old refs to get removed and for the repo's size to get reduced.

I'm not sure if you also rewrote history and pushed the first time that the increase in size happened?

Another possible reason for the increase in size might be a bug we have, where the garbage file in the repo is sometimes counted in the repo size:

However, since the issue is no longer occurring now, I'm afraid it's hard to say what was the case the first time this occurred.

Kind regards,
Theodora

0 votes
Stephen Garber
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2020

Have you deleted files from you repo? If so you'll have to purge the files from the history to reduce the size.

Atlassian has a guide here to reduce the size of the repo.

https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events