Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

repository size reduction not reflected on bitbucket

gkamendje January 27, 2025

I have locally reduced the size of my repository to less than 500MB. However, the size shown in Bitbucket is still 2.2G. Could you please run gc to bring it down? 

Best regards, 

1 answer

1 accepted

0 votes
Answer accepted
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2025

Hi gkamendje,

I have executed a gc which has reduced the size down from 2.2GB to 1.1GB.

To reduce the size further - I would suggest making use of the BFG tool to delete any large binary files present in your repository (or convert them to GIT LFS storage) - here's a command you can use to list these files:

  • 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

 

Cheers!

- Ben (Bitbucket Cloud Support)

 

gkamendje January 30, 2025

Hi Ben, 

Thanks for your answers and suggestions. I would like to understand a couple of things. 

1) When I clone my repo with the mirror option, it is only 354M why is it showing up as 1.1G in Bitbucket?

2) Assuming that I use BFG to remove large files, how do I make sure that the size I see locally matches the size that will be reported by Bitbucket once I push the changes back into bitbucket? 

Regards, 

G

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2025

Hi @gkamendje 

As part of our changes to improve speeds when displaying PR diffs - any large files that were present in PR's within your repository, get stored on the server-side. This is the most common reason why there is a difference:

  • Using BFG should lower the repo size, and also prevent further size increases from subsequent PR's (as these files are no longer present) - existing PR's where these files were present will still contribute to the size

Cheers!

- Ben (Bitbucket Cloud Support)

gkamendje January 30, 2025

Hi @Ben 

I just used BFG to trim down locally to 136M however, when I push back in Bitbucket the size is now bumped to 1.5G. Could it be that another GC is required on your side? 

Thanks

G

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2025

Hi @gkamendje 

A server-side gc has reduced the size back down to 1.1GB as it was before.

Can you please run the following command on your end to check if there are any other files that can be converted/deleted using BFG? Make sure not to share the output here as this is a public forum:

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

 

Cheers!

- Ben (Bitbucket Cloud Support)

 

gkamendje January 30, 2025

Hi @Ben

When I run the command I do not see any significantly large file. The largest files are around 5MB and these are text files (no binary file). As I mentioned before, the repo is down to less than 200MB on my side. 

du -h -d 1
16K ./refs
68K ./hooks
12K ./info
136M ./objects
4.0K ./branches
136M .

 

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2025

Hi @gkamendje 

I'll need to access your repo directly from the server end to investigate this further, so I've raised a formal support ticket on your behalf (please check your email for further correspondence).

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
atlassian, ace, atlassian community event, donation, girls who code, women in tech, malala fund, plan international, kudos, community badge, badge, atlassian badge, International Women’s month, International Women’s Day, women's month, women's day

10 for Change at Atlassian Community Events

Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!

Join an Atlassian Community Event!
AUG Leaders

Upcoming Bitbucket Events