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.

2
  • Select option "merge specific changeset" during merge and proceed. Commented Feb 5, 2020 at 4:09
  • Can you say more in detail?, Please ^^.
    – Tùng Duy
    Commented Feb 5, 2020 at 6:46

3 Answers 3

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.

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

4
  • Thanks so much for reply, However If I follow the steps above, the merge tool will merge also 20, 21, 22 and 23, but I just want to merge changeset 24 but not any other changeset.
    – Tùng Duy
    Commented Feb 5, 2020 at 4:44
  • Did you select just changeset 24 in the next screen?
    – yaakov
    Commented Feb 5, 2020 at 4:45
  • Dear yaakov, Yes, I did that
    – Tùng Duy
    Commented Feb 5, 2020 at 5:01
  • @TùngDuy This does work for me. What does your history say? Where do you see the extra changesets' changes?
    – ruffin
    Commented Nov 12, 2020 at 14:35
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.