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

Run GC on my repo

Sumeet.d.kumar July 1, 2024

Hi Team Atlassian,

I have cleaned my repository from local through bfg and pushed on the server. Can you please run gc on these repos:

git@bitbucket.org:<redacted>.git and

git@bitbucket.org:<redacted>.git

 

Thanks,

Sumeet Kumar

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 2, 2024

Hello @Sumeet.d.kumar ,

thank you for reaching out!

I have executed a GC on both the repositories you shared, and the size was reduced from about ~2.6GB to ~2.4GB. 

As the size didn't reduce much, I would suggest using the following command to list the top 50 largest files in the repo, and use BFG to either delete those files or move them to LFS to further reduce the repository size : 

git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort --numeric-sort --key=2 \
| tail -n 50 \
| cut -c 1-12,41- \
| $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest

Thank you, @Sumeet.d.kumar !

Patrik S

Sumeet.d.kumar July 3, 2024

Hi @Patrik S ,

Does having too many branches also increase the bitbucket repo size? Currently, we have around 4000 branches on my repo. Will cleaning the unused branches help me significantly in reducing the bitbucket repo size?

 

Thanks,

Sumeet Kumar

Sumeet.d.kumar July 3, 2024

Hi @Patrik S ,

I used BFG Repo-Cleaner to delete some files from my Git repository. After running 'git reflog expire --expire=now --all && git gc --prune=now --aggressive'
to perform garbage collection, I still see some same files when I run the `git rev-list --objects --all` command. Is this expected behavior? What steps should I take to ensure these files are completely removed from the repository history?

 

Thanks,

Sumeet Kumar

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2024

Hey @Sumeet.d.kumar ,

After the deletion with BFG and the local GC, the files should now show up in the git-rev-list command.

Could you please confirm if you followed the steps outlined in the below article when deleting those files?

 

Sumeet.d.kumar July 9, 2024

Hi @Patrik S ,

 

Yes, I followed the similar steps. Apart from point 2, I did the same. For file names, I gave wildcard names like abc-*.tgz.  For some of the files which got deleted, it is not coming in the git-rev-list command. However, for others, it does show.

 

What steps can I follow apart from this?

 

Thanks,

Sumeet

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2024

Hello @Sumeet.d.kumar ,

The steps outlined in that article should work for removing the files. I see you have access to a workspace with an active Bitbucket subscription that is entitled to standard support, so to investigate this further, I will be raising a support ticket for you using the same email used to post this question

You should be receiving the support link soon, but in case you don't, please let me know so I can share it with you here (only you and Atlassian staff can access it).

Thank you, @Sumeet.d.kumar !

Patrik S

Like Sumeet.d.kumar likes this

Suggest an answer

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

Atlassian Community Events