Forums

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

How to reduce Bitbucket Cloud repository size after local cleanup and force push?

Numan Shahid
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 27, 2025

Hi Bitbucket Team,

This repository

We recently cleaned up our Git repository to reduce its size. Locally, we ran the following commands:

git reflog expire --expire=now --all
git reflog expire --expire-unreachable=now --all
git prune --expire=now -v
git gc --aggressive --prune=now

We also removed large files and cleaned the commit history using BFG Repo-Cleaner. After that, we force-pushed all branches and tags back to Bitbucket:

git push --force --all
git push --force --tags

Now, the local repository size has been significantly reduced, but the repository size on Bitbucket Cloud still shows the old size and usage warnings remain.

Could you please run a **server-side garbage collection (GC)** on our repository to finalize the size reduction?

 

1 answer

0 votes
Vitalii Rybka
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2025

Hi Numan 

Great job on performing the local cleanup — sounds like you've followed all the right steps with BFG and aggressive GC.

However, in Bitbucket Cloud, server-side garbage collection is not triggered automatically after a force push, and unfortunately, users can’t manually trigger it either.

Here's what you can do:

  1. Raise a support ticket with Atlassian
    Since you're on Bitbucket Cloud, only Atlassian Support can trigger a server-side GC for your repo.
    👉 Submit a support ticket here

    Be sure to include:

    • A link to the repository

    • Confirmation that you've force-pushed all cleaned branches and tags

    • Mention that you're requesting server-side GC to reflect the reduced size

  2. Wait a bit
    Sometimes Bitbucket eventually performs GC as part of its background maintenance, but this can take days or even weeks.

Tip:

Make sure all refs (branches, tags, pull requests) referencing old data are deleted — orphaned references can prevent GC from reclaiming space.

Let me know if you need help double-checking those!

Suggest an answer

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

Atlassian Community Events