4

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.

ruffin
  • 16,507
  • 9
  • 88
  • 138
Tùng Duy
  • 41
  • 1
  • 3
  • Select option "merge specific changeset" during merge and proceed. – Pashupati Khanal Feb 05 '20 at 04:09
  • Can you say more in detail?, Please ^^. – Tùng Duy Feb 05 '20 at 06:46
  • Hi Tùng Duy, any update on this issue, do you have any other concern? If my reply helped or gave a right direction. Appreciate for [marking it as an answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) which will also help others in the community. – PatrickLu-MSFT Mar 05 '20 at 11:53

3 Answers3

3

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

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.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
2

When merging, select the "Selected changesets" option, as shown below. On the next screen, you will then be able to select a single changeset, or Ctrl+click to select multiple.

This screenshot is from VS2019, as I don't have VS2015 on-hand, but the option will be in the same place, even if it may have a slightly different name.

TFS Source Control Merge Wizard

yaakov
  • 5,552
  • 35
  • 48
0

Strange - the select single change set did not work for me first time - I go all changes up to that change set - BUT sequences was Merge from main to production changeset Select change set 7 Select change set 9 In the file for change set 9 I got all the changes up to 9.

So I backed it all out and did Merge from main to production changeset Select change set 7 Check in on branch Select change set 9

This time I got just the changes to the file for change set 9 - not historic changes (i.e. just the diff was applied) So all good.

stuartm9999
  • 139
  • 1
  • 8