Forums

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

Need help with gc for repo over 1GB

lordzombie
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!
July 26, 2025

Like a lot of people on the forum, I need someone to run git gc on my repo since it complains that I have exceeded the 1GB limit.

 

I spent a lot of time looking for a way to do this myself but seems like the only way around this to make a post here.

2 answers

0 votes
Shwetha Suvarna
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 27, 2025

Hi @lordzombie ,

I have attempted to reduce the size of your largest repositories by executing a garbage collection, but it has not reduced the size much (100mb), and your workspace is still 2.5GB:

 

You have a couple of options to resolve this:

Option 1 - Delete & recreate the repositories
This is the fastest way to solve the problem, but loses metadata such as PRs, Pipelines, Permissions, etc.

  1. Perform a clone of those repositories for backup purposes
  2. Delete those repositories from your workspace to free up space and allow you to push. NOTE: This will permanently remove metadata such as PR's/pipelines/user permissions etc
  3. Identify the largest files in your repositories by executing the following command:
    git rev-list --objects --all \
    | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \| awk '/^blob/ \{print substr($0,6)}' \
    | sort -r --numeric-sort --key=2 \ 
    | numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest 
  4. Perform cleanup operations locally to reduce the size.
  5. Once complete, push those repositories back to your workspace by creating a blank repository with the same name of the deleted repository, then mirror pushing the contents of the cleaned repository:

HTTPS
git push --mirror https://<username>@bitbucket.org/<WorkspaceID>/<RepoName>.git
SSH

git push --mirror git@bitbucket.org:<WorkspaceID>/<RepoName>.git

NOTE: This will remove metadata such as PR's/pipelines/permissions etc but will keep your commit history and binary files intact.

Option 2 - Temporarily upgrade

  1. Upgrade to a paid plan and utilise our 30-day trial period to restore functionality and provide more time to reduce your repository directly without deletion. You can choose to continue or cease your trial before the end of the 30-day period.
  2. If you encounter any issues during this period - you may raise a ticket directly with our support team using your workspace URL: Atlassian Support  

Please let me know how this goes.


Best Regards

Shwetha Suvarna

0 votes
Tinker Fadoua
Community Champion
July 27, 2025

Welcome to the Atlassian Community @lordzombie !

I found the following when I googled how to perform yourself GC cleanup knowing that a user can only perform it in DC or Server:

https://www.google.com/search?q=how+to+clean+GC+in+Bitbucket+Cloud%3F&rlz=1C5CHFA_enUS1080US1080&oq=how+to+clean+GC+in+Bitbucket+Cloud%3F&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRigATIHCAIQIRigATIHCAMQIRigATIHCAQQIRiPAjIHCAUQIRiPAtIBCjE2MTkzajBqMTWoAgiwAgHxBf_ngZt30wfR&sourceid=chrome&ie=UTF-8

Let me know how it goes

BEst,

Fadoua

 

lordzombie
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!
July 27, 2025

Hi Fadoua, thanks for replying to my post. 

I have already done these steps locally (use bfg to remove large files from my local git history). But when I try to push this to the remote repo, I get blocked by a message saying "remote: This workspace is over the 1 GB size limit. Reduce the size of your workspace or upgrade to a Standard or Premium plan to increase the size limit."

This effectively blocks me from doing anything to fix this issue on the remote repo. Even after cleaning my history locally, I cannot push anything to the remote repo. It makes the remote repo unusable because of the weird catch 22 situation going on here. 

Any suggestions? 

Like Tinker Fadoua likes this
Tinker Fadoua
Community Champion
July 27, 2025

@lordzombie  I requested Atlassian's assistance since you tried everything you could from your end.

Atlassian will get back to you within 2 days.

Best,

Fadoua

Suggest an answer

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

Atlassian Community Events