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
4,295,683
Community Members
 
Community Events
165
Community Groups

How to perform git gc on a remote repository after BFG large files removal?

Hi,
I cleaned my local repository with BFG tool.
Size was reduced locally. git push --force was performed.
No change in the size of the remote repository was observed.
If I understand correctly a garbage cleanup (git gc) is needed on the remote repository.
Am I correct?

If so, how should it be performed?

Thanks for your assistance,
Kuti.

2 answers

1 accepted

0 votes
Answer accepted
Caroline R Atlassian Team Aug 10, 2021

Hi, @Yekutiel Katz! Welcome to the community! 

To give you some context around the git GC process, Bitbucket triggers a garbage collection on the repository after each push, however aggressive GC is triggered by Git once the unreachable/dangling objects become older than 30 days.

For this reason, there is no need for us to trigger a manual GC for your repository. However, we are happy to run it for you if you feel there is a need. 

I checked all the repositories you have access to and found just one that was over 3 GB, so I ran the GC against this repo. However, the size didn’t change. Is this the repo you would like us to run the GC? 

Besides that, I would like to share with you that we already have a feature request to allow users to mark repositories for git GC, as you can check here:

Please consider adding yourself as a watcher to receive the updates as we make progress with this. If you are not familiar with our Feature Request Policy, you can read more about it here.

Feel free to share any additional information regarding this case.

Kind regards,
Caroline

Hi  Caroline

Thanks for your answer. 

The repo that needs GS is "simfinisegment". I assume that is the one you found. 

I have pushed the changes again with "git push --force --all"

Could you please try running GC against this repo again.

 

Thanks :)

Kuti

Caroline R Atlassian Team Aug 11, 2021

Hi, Kuti! 

Thanks for getting back to me! I ran the GC again and managed to reduce the repo size from 3.9 GB to 1.6 GB :) 

Please let me know if you have any questions. 

Kind regards,
Caroline

Hi  Caroline!

That's awesome.

Thank you very much!

Kuti.

Caroline R Atlassian Team Aug 11, 2021

You are welcome! I'm glad to help! :) 

Kind regards,

Caroline

Well, the FAQ says Bitbucket will run GS automatically but it doesn't explain precisely when.

"Bitbucket runs this operation on its hosted repositories automatically on a regular basis based on a variety of triggers."

Source: https://support.atlassian.com/bitbucket-cloud/docs/do-i-need-to-run-git-gc-housekeeping-on-my-repo/

There is a "provide feedback" link, you could try to get help how to enforce the GC remotely?

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,170 views 2 9
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