Do I need to explicitly close a branch after merging it into trunk? Or is it implicitly considered closed after I merge it? In the former case, what should I do to close the branch? Does it mean I have to delete it?
Merging Branches. Once you've completed work on your branch, it is time to merge it into the main branch. Merging takes your branch changes and implements them into the main branch. Depending on the commit history, Git performs merges two ways: fast-forward and three-way merge.
In a good workflow, the feature branch is deleted once its merged back into master. New branches should be created for each new feature(s) that you work on. If you're not super creative with coming up with branch names and/or want to reuse the same branch name, that is ok.
In software development, a trunk is the base code into which all subsequent code is merged. Copies made from the source code are known as branches, extending outward from the trunk.
Trunk-based development (TBD) is a branching model for software development where developers merge every new feature, bug fix, or other code change to one central branch in the version control system. This branch is called “trunk”, “mainline”, or in Git, the “master branch”.
Yes, you should delete the branch after it has been reintegrated into the trunk. This is well explained in the SVN book:
Once a --reintegrate merge is done from branch to trunk, the branch is no longer usable for further work. It's not able to correctly absorb new trunk changes, nor can it be properly reintegrated to trunk again. For this reason, if you want to keep working on your feature branch, we recommend destroying it and then re-creating it from the trunk
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