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

Easiest path to reducing the size of a repository?

MrConkin October 16, 2022

Hi, I've hit the 4GB limit with my repository and am seeking a path to reduce that size while ensuring that my most recent changes are safe.

In going through the documentation steps (https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/) I have done the following:

- Created a temporary branch with my latest commit

- Reset my master branch back to the previous commit

However at this stage I am uncertain how to proceed with reducing my repository size so I can continue making changes. My older changes do not matter to me, it is just important that my most recent commits are backed up. Is there a way to clear my data prior to a provided commit or something along those lines?

 

2 answers

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2022

Hi @MrConkin,

You mentioned that you started with a new repo without the history and abandoned the old one.

In case you would like to continue with the old repo with the history, I can see the repo that was over the 4 GB size limit. I ran a garbage collection to this repo and its size is 2.8 GB now, so you should be able to push to the repo.

The repo's size is still quite large, so I would suggest reducing it further, if possible. You can check this reply of mine here:

If you decide to rewrite history with BFG to further reduce the repo's size, please keep in mind that the repo's size will get increased again when you push these changes, and the remote repo will need another git gc. I can run it for your repo again then, so that the repo's size gets reduced, just let me know.

Kind regards,
Theodora

MrConkin October 19, 2022

That's very helpful, thank you Theodora. I think I will stick with the new repo so I can start fresh with a stringent gitignore. Appreciate the help and offer though.

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

You are very welcome. If you change your mind or if you have any other questions in the future, please feel free to reach out!

0 votes
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2022

You might have a look at following solution:

How to push a shallow clone to a new repo? 

MrConkin October 17, 2022

Hi Johannes, thanks for the lead.

That process was going relatively smoothly. I created a shallow clone and a new BitBucket repo, but when I attempt to push the clone to the new repo I get this error. Any advice on how to bypass this would be appreciated.

shallow.PNG

MrConkin October 17, 2022

Abandoned that plan and ended up just starting fresh with my latest in a new repo as per:

https://stackoverflow.com/questions/30001304/clone-git-repository-without-history

Suggest an answer

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

Atlassian Community Events