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

Request garbage collection

Dominykas Vilipas December 13, 2021

Hey,

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
Atlassian Team members are employees working across the company in a wide variety of roles.
December 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,
Caroline

Dominykas Vilipas December 13, 2021

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
Atlassian Team members are employees working across the company in a wide variety of roles.
December 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:

https://support.atlassian.com/bitbucket-cloud/docs/use-bfg-to-migrate-a-repo-to-git-lfs/

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

Kind regards,
Caroline

Dominykas Vilipas December 29, 2021

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

Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 3, 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,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events