Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Need git gc on remote

We hit 2GB in our repository. How can we run git gc in remote as we cannot push anything.

1 answer

1 vote
Santosh J Atlassian Team Apr 24, 2020

Hi Cris, Git GC is currently run Internally on a secured server by experts on the Bitbucket end. I would suggest to follow the below steps and see if this helps. 

I would suggest you use the BFG tool in order to remove large files from the repository’s history. As per our Reduce repository size documentation https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html you can use BFG such as $ java -jar bfg.jar --strip-blobs-bigger-than 50M to remove all file bigger than 50M. You can customize the size of the files you want to remove according to your needs. Please refer BFG Repo-Cleaner by rtyley for the link https://rtyley.github.io/bfg-repo-cleaner/ to download the BFG jar and for more information on how to run BFG.

----------------------------------------
Here are the brief steps
----------------------------------------
git clone --mirror git://example.com/some-big-repo.git
java -jar bfg.jar --strip-blobs-bigger-than 50M some-big-repo.git
cd some-big-repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push
----------------------------------------

Post running this step, please reach out to Bitbucket support to run the Garbage Collection at the backend which will help reduce the size immediately. 

Additionally, for future GC process, you can enable the below method:
-----------------------------------------
Beta Feature - Self Serve for Customers:
-----------------------------------------
You can enable an experimental feature to trigger GC automatically next time you accidentally push a large commit and go over the 2GB size limit.

Do this by clicking on your profile icon and selecting Bitbucket Labs, then enabling the feature "Delete dangling commits when oversize limit". This only affects your personal login; tell your team in case they want to try it out too.

Next time you accidentally push large files to Bitbucket, follow the user guide to reset the branch just before the large commit. When you force push that refs-only change, the Labs feature will automatically run GC to immediately remove the large commit. It may take several minutes for the GC to run and the size to update.

This should bring your Bitbucket repo below the size limit, allowing you to push commits again without having to raise a support request. Anyone else using the same repo who has pulled the large commit will need to create a fresh clone.

Note that this won't work if your repo goes over 5GB. In that case your repo is put into read-only mode and you will need to request help from the support team.
-----------------------------------------

thank you this is great!

Santosh J Atlassian Team Apr 24, 2020

your welcome Cris, request you to please accept the answer if you feel this is what you were looking for.

Suggest an answer

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

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

770 views 15 10
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