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

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

Yekutiel Katz August 8, 2021

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

1 vote
Answer accepted
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 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

Yekutiel Katz August 11, 2021

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

Yekutiel Katz August 11, 2021

Hi  Caroline!

That's awesome.

Thank you very much!

Kuti.

Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2021

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

Kind regards,

Caroline

Like Eobin G likes this
0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2021

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
AUG Leaders

Atlassian Community Events