44051

SVN: Merging two branches together

We have multiple developers working on a project. We're employing a feature-branch method of branching in which we do the following:

<ol> <li>All maintenance work and bug fixes are done on the trunk</li> <li>All new functionality is done on a new branch</li> <li>Branch is updated regularly (via merging changes from trunk to branch)</li> </ol>

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!

Answer1:

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 :D

Answer2:

It depends somewhat on what you are trying to accomplish. Why do you want to merge two feature branches? If it's because the two features have logically "combined," just pick one to merge into the other, then do all your development on the merged branch. If it's because there are dependencies on items in the other branches, there is probably enough commonality still to merge into one branch, then only if truly needed, branch off the merged branch to develop a feature independently.

Keeping two non-trunk branches synchronized when they are for different features is likely to cause much pain; I wouldn't recommend it if you can help it.

Answer3:

I assume you regularly merge the trunk and the branches, don't you? If so, after that merge, the trunk and the branches are the same and you can just drop one of the branches and continue using the other one.

If you don't want to merge to the trunk, you can still merge one branch into the second and continue using the second.

Answer4:

Is merging the current state of one of the feature branches to trunk an option? If so, I recommend merging that feature branch to trunk and then updating the other feature branch to the latest in trunk. That way you avoid creating an additional branch and get rid of one of the branches.

Recommend

  • Django HTML truncation
  • Confusing SQL error in SELECT NULL, *, NULL, NULL
  • how to compile code from svn into jar file?
  • C++ face detection/recognition implementations
  • How do I use ggplot2 to create a border around a group of US counties?
  • Can I make `git merge` always conflict on file changes?
  • Avoid merging master into development branch
  • Unable to generate call to cell phone using asterisk
  • Get pretty git rev name
  • Hadoop shuffle uses which protocol?
  • android duplicate provider authority on apps that don't have provider
  • Facebook Messenger Platform - Detect user typing
  • Getting unread count in Sent Folder using Google Apps Script - GMail
  • Can my PDF ping my server when it is opened?
  • Two Tables Serving as one Model in Rails
  • CERN ROOT exporting data to plain text
  • Merging rows to columns
  • Approximate Order-Preserving Huffman Code
  • JqueryMobile Popup menu is not working
  • MVC3 Razor - ListBox pre-select not working
  • Installing Hadoop, Java Exception about illegal characters at index 7?
  • Nant, Vault & Windows Integrated Authentication
  • What is Eclipse's Declaration View used for?
  • JavaScriptCore crash on iOS9
  • Perl system calls when running as another user using sudo
  • htaccess rewriting URLs with multiple forward slashes
  • Jquery - Jquery Wysiwyg return html as a string
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • How do I rollback to a specific git commit
  • Is there a mandatory requirement to switch app.yaml?
  • Transpose CSV data with awk (pivot transformation)
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Change div Background jquery
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How does Linux kernel interrupt the application?
  • Append folder name and increment by 1 using batch script
  • Busy indicator not showing up in wpf window [duplicate]
  • Why do underscore prefixed variables exist?