Forums

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

Request to run git gc on my remote repo

Bahiyah Nor
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 15, 2025

Hi,

 

I have reduced the size of my repo and push. Please help me run git gc on my remote repo.

 

Thanks.

1 answer

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

Hi Bahiyah,

I've ran gc against your two largest repositories (1.5GB/697MB) but they did not reduce in size.

You will need to locate large files in your repositories and reduce the repository size by removing those large files or converting them to GIT LFS:

Here is a command to show your files (sorted by largest at the top):

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

Please note that any cleanup operations create garbage/dangling commits, which will inflate the size. We need to run a server-side gc from our side to complete the process, so please let me know when you're ready to do so.

Cheers!

- Ben (Bitbucket Cloud Support)

Bahiyah Nor
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 16, 2025

Hi Ben,

Thanks for the command. Will do that first and get back to you.

 

Cheers!

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