Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

reduce remote repo size

Manish Maharjan January 24, 2022

I am getting repo over 2.0 GB warning. 
I checked my local repo using 

git count-objects -Hv

The local repo size shows 1.20 GB however my remote repo is 2.67 GB. Any workaround on how i can match my remote repo size to local? 

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.
January 26, 2022

Hi @Manish Maharjan and welcome to the community.

I see that your question has the tag 'bitbucket-server', however, this warning shows for Bitbucket Cloud repos (hosted in https://bitbucket.org/). Could you please first confirm if your repo is hosted in Bitbucket Cloud (https://bitbucket.org/) or in Bitbucket Server (self-hosted instance)?

There is one possibility that the mismatch occurs because your local repo may not have all remote branches locally. I would suggest taking a clone of the repo with the --mirror flag and then run git count-objects -Hv in that mirror clone.

If the output in the mirror clone still shows as less than 2.67 GB, then the remote repo might need a garbage collection because it may have e.g. dangling commits.

In Bitbucket Cloud, users cannot trigger a garbage collection themselves (although we have a feature request to add this functionality: https://jira.atlassian.com/browse/BCLOUD-11593), but we can run it for your repo.

If this is indeed a Bitbucket Cloud repo, can you give me the last 2 letters of the repo so I can identify it and run a git gc for it? Alternatively, if the repo is owned by a workspace on a paid billing plan, you can create a ticket with the support team and request a git gc for the repo. 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.

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

Kind regards,
Theodora

Manish Maharjan January 26, 2022

Hello Theodora,

 

I apologise, yes our repo is hosted in Bitbucket cloud not server.

 

Yes I tried the mirror clone and the size is less than 2.67GB. 

My last two letters of the repo are id. Please let me know if you can run git gc.

 

Thank you,

Manish

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2022

Hi Manish,

Of course, I identified the repo and I ran a git gc for it, its size is 1.1 GB now.

Please feel free to let me know if the warning is gone now and if you need anything further.

You can also add your vote and add yourself as a watcher to the feature request I mentioned (https://jira.atlassian.com/browse/BCLOUD-11593) if you'd like to get notified via email on updates.

Kind regards,
Theodora

Manish Maharjan January 30, 2022

Hi Theodora,

Thank you. It worked. I appreciate your support.

 

Regards,

Manish

Like Theodora Boudale likes this
0 votes
Pramodh M
Community Champion
January 24, 2022

Hi @Manish Maharjan 

Welcome to the Community!!

Use git-lfs-migrate to detect the large files

https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-migrate.1.ronn

You can use bfg-repo-cleaner to reduce the repo size

https://rtyley.github.io/bfg-repo-cleaner

Thanks,
Pramodh

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events