You see 162489 and 162990, How can I merge them ?
-
3It is unclear as to what you want to do with those changesets. Do you only want to merge the changes in those changesets to another branch, hwile ignoring all other changes? – Robaticus Oct 11 '10 at 12:12
-
See http://stackoverflow.com/a/22729936/67824 – Ohad Schneider Mar 29 '14 at 10:38
4 Answers
I'm guessing that you want to merge only those two specific changesets into another branch.
You cannot merge multiple changesets in one go, unless the changesets are in sequence.
Using the tf
command line tool you specify a range of versions by separating the version with a tilde character.
tf merge /recursive /version:C162489~C162990 "$/SourceBranch" "$/TargetBranch"
In this case the changes 162987 and 162967 will also be included.
If you are using the UI in Visual Studio then the merge dialog will prevent you to select multiple individual changesets unless they are in sequence.
To merge two separate changesets into another branch you will have to do it in two steps:
merge 162489 and then 162990 (start with merging the oldest changeset in case both changesets contain changes to the same files).
Then your workspace for the target branch will contain the changes for both changesets and now you can check-in the merges as one changeset in the target branch.

- 2,923
- 2
- 23
- 40

- 1,638
- 1
- 15
- 17
-
13One problem here. If you merge 162489 first, you CANNOT merge 162990 unless you checkin 162489 first. – Kiril Stanoev Jan 18 '11 at 14:45
-
1@KirilStanoev I don't believe this. You can merge whatever you want as long as you do it separately – Ozkan Mar 21 '19 at 07:09
In the TFS Merge help - http://msdn.microsoft.com/en-us/library/bd6dxhfy(v=VS.100).aspx -, you see in the 2nd example how you can merge one changeset:
tf merge /version:C137~C137 branch1 branch2 /recursive
Is that what you are after?

- 12,688
- 3
- 39
- 44
Try this
tf merge /recursive /version:C162489~C162489 "$/SourceBranch" "$/TargetBranch"
tf merge /recursive /version:C162990~C162990 "$/SourceBranch" "$/TargetBranch"
If you don't have a conflict code change in these changeset TFS 2010 will merge consecutive merges.

- 171
- 2
- 4
-
2Many thanks! I did not know that if I want to merge a single shelveset I also have to specify it as a range (if I just give the shelveset, it seems to merge accumulated changes). – Andreas Reiff Oct 16 '14 at 07:04
Merge must be done in successive manner. In your case merging two changesets that are not successive is not safe because you can loose changes that could be done to the same files. That is why TFS client does not allow you to do that.

- 15,744
- 43
- 110
- 148