Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to run Garbage Collection on server-side repostories

Fabian Wohlfart April 11, 2025

I am cleaning up my workspace, due to the just announced changes in storage for workspaces.

https://www.atlassian.com/blog/bitbucket/important-changes-coming-to-bitbucket-clouds-free-plan

I am using Bitbucket since I began coding years and years ago, so I have some old, dusty, but also unknowingly big repositories.

So I am on a quest to cleanup my workspace. I use git filter-repo to remove files, getting, for example, the size of a local repository down to 8mb from 350mb. which is reasonable for what the repo now is. Nearly the same procedure is suggested in this first-party blog entry of the support:

https://support.atlassian.com/bitbucket-cloud/kb/how-to-remove-files-from-the-commit-history-in-bitbucket-cloud/

I do the same the last commands as suggested in the blog article:
git reflog expore --expire=now --all && git gc --prune=now --aggressive
git push --force

Big caveat: (quote) Please make sure to contact our support through https://support.atlassian.com/contact/ to run the Garbage Collection on the server-side repository and get rid of the unwanted commit.

What does the support say?
Nothing, I am not able to contact the support.

Bitbucket Free comes with Community Support. Upgrade to a paid plan to get one-on-one customer support. 

How should I cleanup my workspace, if my repository is cached and instead of decreasing it increases with each push? The 350mb remote repository is now at 400mb because i »cleaned« it 3 times…

Help.

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 13, 2025

Hi @Fabian Wohlfart

Welcome to the community.

If you could provide your masked repository URL, I'll run Git GC against the repository.

Sample masked repo URL: https://bitbucket.org/wo*****ce/rep*****ry

Regards,
Mark C

 

Fabian Wohlfart April 14, 2025

Thank you.
This URL?

https://REDACTED@bitbucket.org/REDACTED/REDACTED.git

We can test with one, and then I will send the other links, I have 26 more repos to clean.

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 14, 2025

Hi @Fabian Wohlfart

I've run GC now, could you check the size now?

Regards,
Mark C

Fabian Wohlfart April 15, 2025

Thanks!

It went down from ~400mb to ~146mb.

My local repository is 8mb.

If I clone the repository its also ~8mb.

Yet it still shows ~146mb in bitbucket, how can this be?

git count-objects -vH
count: 0
size: 0 Bytes
in-pack: 6047
packs: 1
size-pack: 8.24 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 Bytes

 

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2025

Hi @Fabian Wohlfart

Could you confirm if you've used the BFG tool mentioned in our guide here to reduce the repository size?

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events