Donotalo
Donotalo

Reputation: 13035

Merging a changeset to parent's parent in TFS

I'm using Visual Studio 2010 Ultimate. In the TFS, we have the following:

-main
-sk\v1.0
-hotfix\v1.01

Here, main is the main branch. The branch v1.0 is created from main in sk folder. The branch v1.01 is created from v1.0 in hotfix folder.

I did some changes in v1.01. Now I want to merge them back to main without affecting v1.0. From Source Control Explorer, I right clicked on v1.01 and selected Merge... from Branching and Merging menu. In the resulting dialog box, there was a combobox which lists all target branches where merge can be performed. That combobox only lists v1.0.

How can I merge changes in v1.01 to main without affecting v1.0?

Upvotes: 0

Views: 1004

Answers (1)

gregpakes
gregpakes

Reputation: 4535

I think in future, if this is the workflow you wish to make, then you should branch v1.01 from main rather than from v1.0. That way, you could merge v1.01 back into main without affecting v1.0.

However, as you haven't done that, I think your only choice would be to perform a baseless merge.

tf.exe merge /baseless <parent branch> <child branch>

That will create a parent - child relationship between between the two branches. Check in your pending changes.

Now, back in VS, select the v1.01 branch and click File -> Source Control -> Branching and Merging -> Reparent. Select Main from the pop up window. You should now be able to merge between these two branches.

See here for more info.

Upvotes: 1

Related Questions