Forums

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

How can I remove large commits for good?

smelcher53
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!
April 21, 2025

I've tried several different options that I found online without success.  One of them seemed to corrupt the repository and the others seemed to double the size of the repository.

I do NOT need the history of the large commits.

My goal is to reduce the size of my repository to under the 4GB limit.  The initial large commits were done by mistake

1 answer

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

Hi @smelcher53 

I assume you are referring to the 1GB workspace repository size limit that will be imposed on 28th Apr.

The largest repo I saw on your workspace was 1006 MB. I executed a garbage collection, which reduced the size to 997.2MB.

To reduce further I'd suggest checking your largest files first:

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

Once you have those large files, remove those files using the BFG tool - there are instructions below:

Once you've performed the cleanup operation - please let me know and I will execute a final garbage collection on the server-end. It is normal for the size to increase temporarily until the final gc is executed from my side.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events