在 TFS 中,如何将变更集挑选到不相关的分支?
我有一个非常混乱的 TFS 结构,我正在尝试清理它(感谢我的前任)。我现在遇到一种情况,我需要有选择地将变更集从一个分支转移到另一个没有父/子关系的分支,并且我不希望这些更改通过他们的共享主干。我该怎么做?
我尝试过无基础合并 - 在 TFS 中,如何对特定变更集进行无基础合并? - 这告诉我没有要合并的更改。
我想要实现的是这样的 TFS :可以搁置集恢复到另一个位置? 除非有变更集。
在 GIT 中,我认为这将是一个简单的选择。
我的结构看起来像:
Y-C1-C2-C3
/
X-------------
\
Z
问题是如何在不经过 X 的情况下从 Y 得到 C2 到 Z ?
I have a very messy TFS structure that I am trying to clean up (thanks to my predecessor). I now have a situation where I need to bring changesets selectively from one branch to another where they don't have a parent/child relationship and I don't want those changes to pass through their shared trunk. How can I do this?
I have tried a baseless merge - In TFS, how do I do a baseless merge on specific changesets? - which told me that there were no changes to merge.
What I want to achieve is something like this TFS : Can a shelveset be restored to another location? except with a changeset.
In GIT I think this would be a simple cherry-pick.
My structure looks something like:
Y-C1-C2-C3
/
X-------------
\
Z
And the question is how do I get C2 from Y into Z without passing through X?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们也有类似的情况,但在我们的例子中,我们将多个分支进行无基础的合并到“临时”构建分支。我们能够做到这一点的唯一方法是利用 TFS API 编写我们自己的实用程序。
好消息是,您应该能够用不到几百行代码来完成此任务。
基本步骤是:
VCS.GetChangeset()
Changes
以获取已更改的项目列表Workspace.Merge
。We have a similar situation, though, in our case, we do a baseless merge from multiple branches into a "scratch" build branch. The only way we were able to do this is by writing our own utility leveraging the TFS API.
The good news is, you should be able to accomplish this in less than a couple hundred lines of code.
The basic steps are:
VCS.GetChangeset()
Changes
to get a list of items that have changedWorkspace.Merge
for each of the items from your source branch to your destination branch.使用 Visual Studio 来实现更简单。
在 Visual Studio 中,使用源代码管理合并向导来合并不相关的分支。
它有一个选项可以合并选择性变更集。唯一的限制是变更集必须是连续的
Its simpler to do it using Visual studio.
In Visual studio use the Source Control Merge wizard to merge the unrelated branches.
It has an option to merge selective changesets. The only restriction is that the changesets must be consecutive