Forums

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

Reduce repo size

subhojit1480 October 24, 2023

The size of the repo showing is 3.04 GB.

Could you delete large files from old commit history so size will be decreased?

2 answers

1 accepted

0 votes
Answer accepted
subhojit1480 October 27, 2023

Could you reduce a little more, I mean could you run git gc for the repo again so that the size will under 2gb?

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 25, 2023

Hi @subhojit1480,

I checked the repos your account has access to and I ran a git gc for the repo with a size of 3 GB. The repo's size has been reduced, but it is still over 2 GB.

Please keep in mind that Atlassian cannot rewrite history in order to delete large files from customers' repos. This is something that needs to be done by end users.

You can check this post of mine with more details about how to identify large files in your repo and your options:

After you push a history rewrite to the Bitbucket repo, the repo's size will most likely increase because it will have both old (prior to history rewrite) and new references. You can then request another git gc for the old commits (prior to history rewrite) to get removed and for the repo's size to get reduced.

Please feel free to reach out if you have any questions!

Kind regards,
Theodora

subhojit1480 October 25, 2023

Could you reduce a little more, I mean could you run git gc for the repo again so that the size will under 2gb?

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 27, 2023

Hi @subhojit1480,

I'm afraid that git gc does not work this way. I cannot specify in the command a parameter like "reduce the repo size to X GB". What a git gc does is remove any commits that are no longer referenced by any branches and compress file revisions.

Running a second git gc will help reduce the size further only if there are changes in the repo like a history rewrite that removes any large files or deletion of unmerged branches that have large files. I ran another git gc just now, but the repo size remains the same.

You can check the link I posted in my previous reply for more info on how to remove large files from history and you can reach out if you have any questions.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events