在 TFS2008 中重新设置分支的父级
假设我在 TFS 中有分支 A,从中获取分支 B。在 B 上进行了一些更改集,然后从 B 中获取了分支 C,并在分支 C 上进行了更多更改
A ------------------------------
|
B ----1--2------------------
|
C ----3-----4---
现在假设我们想要从 C 合并到 A,但是绕过 B.TFS 不允许这样做 - 我必须进行无基础的合并,这可能很容易出错。真的,我想让 C “重新设置父级”(如果这是正确的术语),因此它是 A 的子级,而不是 B。换句话说,我希望最终得到以下分支结构。 (C' 可以是原始的 C 分支,也可以是 C 本来应有的新分支)。
A ------------------------------
| |
B | ----1--2------------------
|
C' |-------1--2----3-----4---
现在 C' 可以正确合并到 A 中,而无需进入 B。
我的问题是,是否有任何自动化工具/脚本可以设置创建 C' 分支所需的挂起更改,因为手动执行此操作将需要我们非常长时间很久?
Say I have branch A in TFS from which I take branch B. Some changesets are made on B, then from B, branch C is taken, and more changes are made on branch C
A ------------------------------
|
B ----1--2------------------
|
C ----3-----4---
Now suppose we want to merge from C into A, but bypassing B. TFS won't allow this - I have to do a baseless merge, which can be very error prone. Really, I want to get C "reparented" (if that is the correct terminology) so it is a child of A, not B. In other words, I want to end up with the following branch structure. (C' can either be the original C branch, or a new branch that is what C should have been).
A ------------------------------
| |
B | ----1--2------------------
|
C' |-------1--2----3-----4---
Now C' can be merged correctly into A without going into B.
My question is, is there any automated tool / script that could set up the pending changes required to create the C' branch, as to manually do this would take us a very long time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 TFS 中重新设置分支父级是很困难的。您可以通过无基合并有效地给它一个额外的父级,但是:
您 所要求的——我同意这是最好的解决方案——是一个名为 C' 的全新分支,它的内容恰好与今天的 C 相同。这是实现这一目标的快速方法:
此方法的唯一缺点是您不会看到更改 3 和 3。历史上有4个。当然,它们仍然位于 C_old 下,但像 Annotate 这样的工具不会知道这一点——它们会看到这些更改在您创建 C' 的日期一次性发生,没有单独的注释/工作项/ ETC。
Reparenting a branch in TFS is hard. You can effectively give it an additional parent via baseless merge, but:
What you seem to be asking for -- and I agree is the best solution -- is a brand new branch named C' that happens to have the same contents that C does today. Here's a quick way to achieve that:
The only disadvantage of this method is that you won't see changes 3 & 4 in the history. They'll still be under C_old, of course, but tools like Annotate won't know that -- they'll see those changes as occurring all at once, on the date you created C', without the individual comments/work items/etc.