.net 如何仅合并两个变更集 (TFS)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3905901/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to merge two changesets only (TFS)
提问by Bilgin K?l??


You see 162489 and 162990, How can I merge them ?
你看到 162489 和 162990,我该如何合并它们?
回答by Martin Hyldahl
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 tfcommand line tool you specify a range of versions by separating the version with a tilde character.
使用tf命令行工具,您可以通过用波浪号分隔版本来指定版本范围。
tf merge /recursive /version:C162489~C162990 "$/SourceBranch" "$/TargetBranch"
In this case the changes 162987 and 162967 will also be included.
在这种情况下,还将包括更改 162987 和 162967。
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.
如果您在 Visual Studio 中使用 UI,则合并对话框将阻止您选择多个单独的变更集,除非它们按顺序排列。
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).
要将两个单独的变更
集合并到另一个分支中,您必须分两步完成:合并 162489 和 162990(从合并最旧的变更集开始,以防两个变更集都包含对相同文件的更改)。
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.
然后目标分支的工作区将包含两个变更集的更改,现在您可以将合并作为目标分支中的一个变更集检入。
回答by Ewald Hofman
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:
在 TFS 合并帮助 - http://msdn.microsoft.com/en-us/library/bd6dxhfy(v=VS.100).aspx- 中,您可以在第二个示例中看到如何合并一个变更集:
tf merge /version:C137~C137 branch1 branch2 /recursive
tf 合并 /version:C137~C137 branch1 branch2 /recursive
Is that what you are after?
这就是你所追求的吗?
回答by Noushad Poovakkattil
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.
如果这些变更集中没有冲突代码更改,TFS 2010 将合并连续的合并。
回答by Captain Comic
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.
合并必须以连续的方式进行。在您的情况下,合并两个不连续的变更集是不安全的,因为您可能会丢失可以对相同文件进行的更改。这就是 TFS 客户端不允许您这样做的原因。

