We have multiple developers working on a project. We’re employing a feature-branch method of branching in which we do the following:
- All maintenance work and bug fixes are done on the trunk
- All new functionality is done on a new branch
- Branch is updated regularly (via merging changes from trunk to branch)
However, we’ve run into a situation that 2 branches [we’ll call them feature-branch-1 and feature-branch-2] need to be merged together. What is the best way to accomplish this? Part of me thinks we should create a new branch. Then, merge that branch with the first feature branch [feature-branch-1]. And then merge with the second feature branch [feature-branch-2] and take care of the conflicts (which will most likely be the project files).
Is there a better way?
Thanks guys!
Oooh the merging. Love it.
If you mean you want to combine feature-branch-1, feature-branch-2 and trunk into some new branch then yes – your way is good. Otherwise I wouldn’t waste precious time and just copy feature-branch-1 and merge feature-branch-2 into it. You’ve probably would’ve done it already instead of asking this question 😀