Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge only a specific changeset (TFS)

Tags:

c#

tfs

I have a problem where I want to merge a specific changeset from my main branch to my release branch.

I am using Visual Studio 2015 together with team services (TFS).

I performed the following steps:

  • Select the main branch
  • Choose the option merge
  • Select the correct release
  • Select the "selected changeset option" press next
  • Select the change set that I wanted to merge with the branch
  • Press finish to start

Expected: Only the changes in the selected changesets are applied
Actual: The program merges up to the selected changeset.


Here's a specific scenario:

The project is branched when the main branch was at changeset 19

The main branch now also contains changeset 20 through 25

I want to merge changeset 24, but not any other changeset, into the child/release branch.

If I follow the steps above, the merge tool will merge also 20, 21, 22 and 23 from main into the child.

My question is if there is an easy way to merge just the selected changeset (24) and not any other changeset?

I have tried the commandline but it gives me the same result.

like image 243
Tùng Duy Avatar asked Sep 02 '25 06:09

Tùng Duy


1 Answers

You cannot merge multiple changesets in one go, unless the changesets are in sequence. Take a look at below similar question:

  • how to merge two changesets only (TFS)
  • TFS merge changeset into file with pending change

You have to merge either a single changeset or a sequential changesets in one go.

I have tried the command line but it gives me the same result.

I am afraid you may use the wrong format.

The following example merges all the changesets up to changeset 24 into branch2.

c:\projects>tf merge /version:C24 branch1 branch2 /recursive

The following example merges changeset 24 into branch2.

c:\projects>tf merge /version:C24~C24 branch1 branch2 /recursive

In you case , please select /version:C24~C24 when you use the command line to merge.

like image 81
PatrickLu-MSFT Avatar answered Sep 04 '25 21:09

PatrickLu-MSFT