I have some maintenance branches in Git that were used to create emergency releases (i.e. to fix a critical bug in production). These branches are usually not merged back to master, because they either contain one-off fixes or have changes that were cherry-picked from master.
As a matter of practice, should these maintenance branches be deleted in Git if they are tagged (at build time)? Will deleting them cause those commits to be lost?
No commit will be lost if it's reachable from a tag or a branch head.
If you tagged a branch, and then made another commit, and then deleted the branch, that last commit would be liable to garbage collection (at some point in the future - you can still recover it using reflog if you don't wait too long).
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