How can a user force a gargabe collection in bitbucket git?

knowledgesource August 11, 2021

In order to reduce the size of repository git@bitbucket.org:gnoetics/cg-nlp-engines.git I did the following:

1. Created a Git LFS repository and moved all my jar files from cg-nlp-engines to the LFS repo (No problems)

2. git deleted all the jar files in the original repo and pushed it... but the bitbucket repo got bigger, so I read the how to for reducing repo size, and...

3. I cloned the original repo and used BFG to remove all the *.jar files from the history && git reflog expire --expire=now --all && git gc --prune=now --aggressive && git count-objects -vH (which showed local repo down to 611.35 Mb) && git push --all --force && git push --tags --force (No warnings or errors)

4. BUT... now my bitbucket repo says it is 4.1 GB in size and is locked.

5. Is there any way I can force a garbage collection in bitbucket?

3 answers

0 votes
knowledgesource August 26, 2021

Repository was still not garbage collected so I

* created a new empty repo on bitbucket,

*imported my local repo into the new empty repo per instructions on https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html

*gave the remote repo that needs gc a new name (just rename the repo on "Repository settings" page at bitbucket online)

*changed the new remote repo name to the original name of the one that needs gc

*now able to use the new properly sized repo

Will leave the old renamed remote repo that needs gc up for a while before deleting just to see how long before it gets a gc.  Will leave another message about that.

knowledgesource September 20, 2021

Now 4 weeks later and the oversize repository has not been garbage collected.  Will have to delete it.

0 votes
knowledgesource August 25, 2021

Problem returned.  One developer pushed from their local repo before doing all the steps listed above and blew the repo back to even larger than it was before.  We did the steps to reduce ALL local repos to ~620MB, but the bitbucket git repo keeps growing.  It has been several days and no evidence of GC running on the bitbucket repo which is now above the 4GB limit and blocking all pushes, but a clone of the repo comes in at only 624 MB.  How often does GC run on bitbucket???  Is there any way to initiate or request a bitbucket GC????

0 votes
knowledgesource August 12, 2021

Garbage collection ran (or was run).  All is well.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events