How do I merge unrelated branches?

In Team System source control, you can only normally merge branches that are previously related.

In other words, if you branch from the root like so:

root
  branch1
  branch2

You can merge back and forth between root and branch1, or root and branch2, to your heart's content, but you cannot merge between branch1 and branch2. They are unrelated. If you try to merge using the GUI tool, you'll see that the only targets provided for branch1 and branch2 are "root" (the parent). And if you try it from the command line using "TF MERGE", you'll get an error:

c:>tf merge branch1 branch2
The item $/Demo/branch2 is not a branch of $/Demo/branch1.

One solution is to force them to be related by changing your branch strategery:

root
  branch1
    branch2

However, there's an easier way. You can also perform what is called a baseless merge, but only from the command line.

tf merge /baseless branch1 branch2 /recursive

This also establishes a merge history relationship between those two branches, as Buck Hodges helpfully points out. So subsequent merges won't require the baseless qualifier-- but they do still have to be merged from the command line; they can't be merged from the GUI.

posted on Thursday, July 13, 2006 4:55 PM by jatwood

Comments

# VSTS Links - 07/17/2006

Dave McKinstry on hints for expediting Team Build script deployment.

Roy Osherove on using Source...
Monday, July 17, 2006 11:22 AM by Team System News