Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a branch merged into trunk considered closed?

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?

like image 700
B Faley Avatar asked Mar 10 '12 07:03

B Faley


People also ask

What happens when a branch is merged?

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.

Does a branch still exist after merging?

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.

What is the difference between trunk and branch?

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.

What is the difference between trunk and branch in git?

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”.


1 Answers

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

like image 198
JB Nizet Avatar answered Sep 20 '22 07:09

JB Nizet