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.
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
@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."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.