Except for readability and clutter issues, should you remove git branches that will probably never be used again ? Does it improve git performance or has any effect on the total size of your repository ?
It's not a duplicate of Should I remove merged branches? because I don't want to know how to remove git branches, but only, why I should delete them.
Unused branches contains changes and commits so they concur to the total size of your database.
When you delete a branch and the branch is not referenced anywhere else in the repository (for example there isn't a tag pointing to it), then git will be able to release the space used by the changes stored in the branch (immediately or after a garbage collection).
Whether you should remove the unused branches or not depends on whether you care to keep unused code around. If space is an issue, then you may want to delete them.
If space is not an issue, then you can keep them around as much as you want.
I personally delete unused branches because I don't like to have them around unless I don't need them for the following reasons:
I believe it's important to mention that if the branch is merged into master or it is contained in another branch (actually, master itself is a branch) then deleting it will not allow you reclaim the space. This is because 3 branches pointing to the same references use exactly the same amount of space (except for the very limited space required to save the branch metadata).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With