Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Request garbage collection


I think one of our repositories needs a garbage collection, after following the recommended reduction steps. Online is at 2.43 GB

Given that there is no way to open a ticket for that - Can someone from the Team run it for us on the oversized repo?

Thank you so much!

1 answer

0 votes
Caroline R Atlassian Team Dec 13, 2021

Hi, @Dominykas Vilipas! Welcome to the community! 

I run the GC against the repository that was showing 2.43 GB, however, the size hasn’t changed. Could you please confirm the steps you have followed to decrease the repo size?

Looking forward to hearing from you. 

Kind regards,

my steps were

git reflog expire --expire-unreachable="now" --all
git prune --expire="now" -v
git gc --aggressive --prune="now"

 repository now is from scratch so need to delete old history , now if I am not mistaken is only 5 commits

Caroline R Atlassian Team Dec 16, 2021

Hi, Dominykas. 

Thanks for the additional information. The commands you have run have performed a local GC on your repository. However, the GC will just remove dangling commits and repack your repo, but it won’t affect the repository size that much.

So, in case you want to decrease the repo size, you could for example remove large files and use BFG to remove them from the history, and then we can run the GC on our side to also remove them from the remote repository as well. You can also move these large files to LFS if you want.

In order to perform these changes on your repo, the following documentation has a very good explanation of how to achieve this:

I hope this helps, but do let me know if you have any questions. 

Kind regards,

It doesnt help because repo size is only 1GB when i clone It so something calculated wrongly in bitbucket

Caroline R Atlassian Team Jan 03, 2022

Hi, @Dominykas Vilipas

You mentioned that your "repository now is from scratch so need to delete old history". Could you please clarify what exactly you mean by that? Did you delete the .git folder of the repo and initialize a new repository? Or have you performed anything in your local repo to delete older commits besides the commands you reported above? 

Also, could you please take a mirror clone of the repo (with the --mirror flag) and then run the following command inside the mirror clone directory, and share the output with us?

git count-objects -vH

This will show us the exact size of this repository. Please note that if you take a clone without the mirror flag, only the main branch will be pulled locally, so we need the output of this command on a mirror clone.

Looking forward to hearing from you. 

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,440 views 4 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you