Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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

Atlassian Community Events