After deleting branches storage didnt reduce

peeyushsinghal94
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!
February 17, 2025

I deleted multiple branches, but the repository size hasn’t decreased. How can I reduce the size of the repository? Can someone suggest a solution? It's urgent.

2 answers

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2025

Hi @peeyushsinghal94 and welcome to the community!

If the branches you deleted have already been merged to another branch that hasn't been deleted, then the branch deletion won't make a difference to the repo's size.

However, if you deleted branches that haven't been merged to another branch yet, a garbage collection should run to remove any dangling commits that were previously accessible from this branch. Then, you may see a difference in size, but that depends also on the the size of the dangling commits that get removed.

A garbage collection runs on every push but with different parameters depending on many different conditions. If you want, I can run a garbage collection on your repo manually that should optimize the repo better. I'd need to know the first two letters of the repo name and the first two letters of the workspace ID it belongs to, or any other combination of letters that will help me identify it among the ones you have access to. Please feel free to let me know if you'd like me to do that.

In case you version any large files on other branches that you don't want to/can't delete, you may want to consider either removing them from the repo's history completely, or tracking them with Git LFS. You can check this reply of mine to another question that has more details on how to identify large files and the two options (removing them or tracking them with Git LFS):

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

1 vote
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

@peeyushsinghal94 welcome to the Atlassian community

Take a look at this: https://community.atlassian.com/t5/Bitbucket-questions/Is-deleting-recreating-a-branch-easiest-way-to-remove-large/qaq-p/2286337 

"Branches are just pointers to different parts of the history and removing a branch will have no effect on the size of the repository, since the history of the large files is still in it. The only way to remove large files from the history is to clear the history out. You can read more about in this KB."

Suggest an answer

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

Atlassian Community Events