如何修复TFS错误的分支 [英] How to fix TFS incorrect branching

查看:63
本文介绍了如何修复TFS错误的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个项目在TFS 2010中,并且分支错误。我们要修复它。
这是当前的结构:

We have a project that is in TFS 2010 and was incorrectly branched. We want to fix it. This is the current structure we have:


  • 发展

  • 集成

  • Main

问题是 Main 集成(又是开发的分支),
应该恰好相反。

The problem is that Main is a branch of Integration, which in turn is branch of Development, when it should be the very opposite.

换句话说,首先创建了Development,然后分支了Integration,然后是Main。

In other words, first it was created Development, then branched Integration and then Main.

现在,所有三个分支都具有相同的代码(被合并)。

Now all three branches have same code (were merged).

因此,是否有可能将TFS引用修复为正确的流程: Main -> Integration - > 开发

So, Is it possible to fix the TFS references to have the right flow: Main -> Integration -> Development?

推荐答案

据我所知,没有办法进行此更改现场。您面临的问题是Development和Main分支位置不正确。解决此问题的最简单方法是将开发分支重命名为主要,反之亦然,或者使用答案末尾所示的REPARENT选项。

As far as I know, there is no way to make this change behind the scenes. The problem you have in hand is that the Development and Main branches are out of place. Easiest thing to fix this would be to rename the "Development" branch as "Main" and vice-versa or Use the REPARENT option as shown at the end of the answer.

假设您的情况是因为您只有一个DEV分支(使用当前的分支结构不可能有1个以上的dev),那么在当前版本正式投入生产之前不会进行下一个版本的开发吗?在这种情况下,您可以等到当前版本结束后再重命名分支,以便在重命名之前所有3个分支都保持同步。

Am assuming that in your case since you have only one DEV branch (it wouldnt be possible to have more than 1 dev with the current branching structure), the development for the next release wont happen till the current release is out in production right? In that case, you can wait till the end of the current release and then rename the branches, so that all the 3 branches are in sync before the rename.


(请注意,重命名变更集将影响分支中的所有文件和
文件夹,并通过注释下面我可以理解
,如果您在错误的时间操作会很麻烦,请明智地选择
的时间,并确保各分支机构之间的
没有待处理的更改只是分支之间挂起的重命名变更集

(Keep in mind that "Rename" changeset would affect all the files and folders in your branch, and from the comments below I can understand that it can be very problematic if you do it at the wrong time. Choose your time very wisely, make sure that you dont have any changes pending between the branches and it's just the "Rename" changeset thats pending between branches)

另一种方法是使用REPARENT。
在下面的评论中进行了精彩的讨论后,我亲自尝试了这些选项,而解决此问题的最佳方法是使用 Reparent选项。我通过创建三个不同的分支自己进行了尝试。您可以执行以下操作对其进行修复:

Another approach would be to use REPARENT. After a great discussion in the comments below, I tried the options myself and the best way to fix this would be to use the "Reparent" option. I tried this out myself by creating three different branches. You can do the following to fix it:


  1. 在Visual Studio中,单击Main分支->然后单击File-> Source控制->分支和合并->父项。选择没有父项,然后单击父项

  1. In Visual Studio, Click on the Main branch -> then File -> Source Control -> Branching and Merging -> Reparent. Select "No Parent" and then click "Reparent"

单击INT分支->然后单击File-> Source Control->分支和合并-> Reparent 。选择 Main,然后单击 Reparent。

Click on the INT branch -> then File -> Source Control -> Branching and Merging -> Reparent. Select "Main" and then click "Reparent".

单击DEV分支->然后单击File-> Source Control->分支和合并-> Reparent 。选择 INT,然后单击 Reparent。

Click on the DEV branch -> then File -> Source Control -> Branching and Merging -> Reparent. Select "INT" and then click "Reparent".

这篇关于如何修复TFS错误的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆