重命名分支,然后将名称重用于新分支? [英] Rename a branch and then reuse the name for a new branch?

查看:107
本文介绍了重命名分支,然后将名称重用于新分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我们有这样的分支结构:开发->释放。我想对其进行更改,以使其看起来像 TFS分支指导文档称为基本分支计划。 。看起来像是Develop<-Main->

Currently we have a branch structure like this: Develop --> Release. I want to change it so that it looks like what the TFS Branching Guidance document calls "Basic Branch Plan". It looks like this Develop <-- Main --> Release.

我打算这样做:


  1. 将Develop重命名为Main(创建Main-> Release) )

  2. 从此Main创建分支,重用开发名称(创建Develop<-Main->版本)

我会在TFS为新分支重用旧分支名时遇到问题吗?

Will I have problems with TFS reusing an old branch name for a new branch? Know any gotchas or things to look out for?

其他信息
我在一个测试实例中执行此操作,创建了没有任何文件的测试分支,未完成更改,历史记录等(不是一个很好的 real 测试),而TFS可以让我轻松地进行重命名和分支。但是,除非我可以接受生产的TFS项目集合,将其还原到测试实例中,然后对真实数据进行重命名/分支测试,否则我不会满意。有很多历史和分支机构,我不知道会发生什么。正如答案中指出的那样,在执行此操作之前还有其他注意事项。

Additional Info I did this in a test instance creating test branches without any files, pending changes, history, etc. (not a good real test) and TFS let me do the rename and branch without difficulty. However, I won't feel comfortable with this unless I can take our production TFS project collection, restore it in the test instance, and test the rename/branch on real data. There is a lot of history and branches there and I don't know what will happen. As noted in the answer, there are other considerations before doing this.

推荐答案

我正准备做类似的步骤(除了我

I'm preparing to do similar steps (except I'm moving subfolder locations of both parent and a child while grandchildren stay put.)


  1. 何时计划重命名?

  2. 在Develop分支下是否有您未提及的子分支?

  3. 您是否有任何针对Develop的货架可能受到重命名的影响?

一般回答:警告。根据我的阅读分支,在TFS2010中重命名可能会导致一些意外的副作用。 TFS将针对您的情况执行以下步骤(在幕后):

General answer: Proceed with caution. From my reading branch renaming in TFS2010 can cause a few unexpected side effects. TFS will be doing the following steps (under the hood) for your scenario:


  1. 将Develop重命名为Main ==> Branch Develop的Main分支,然后删除Develop分支

  2. 从Main

创建新的 Develop分支我建议阅读以下帖子:

I recommend reading the following posts:


MSDN博客> ChandruR的博客> TFS 2010中的重命名分支
因此,我对这种情况的建议:

"MSDN Blogs > ChandruR's Blog > Renaming branches in TFS 2010 So my recommendations for this case:


  1. 避免重命名分支-更清洁解决方案是,在发行版的正确位置将所有更改合并到父分支,然后重新分支以创建新的分支层次结构。

或者是为了勇敢的勇敢者:)

Or for the brave of heart :)


  1. 您需要计时分支的名称,直到发行版中可以合并到所有相关分支的位置。要遵循的步骤是:
    ...




在TFS2010中重命名分支-但这对我有效PC!



Renaming branches in TFS2010 - But it works on my PC!


在TFS 2010幕后,重命名实际上是一个分支和删除过程,这意味着我们最终除非您已启用在源代码管理浏览器中显示已删除的项目,否则这是不明显的……

"In TFS 2010 behind the scenes a rename is actually a branch and delete process, this meant we ended up with the new branch, but also a deleted branch of the old name. This is not obvious unless you have ‘show deleted items in source control explorer’ enabled…"

现在实现为分支+幕后删除(新名称从旧名称中分支出来,然后删除旧名称)。这样可以实现历史记录的可追溯性,但可以使我们解决合并重命名的问题(请参阅添加,重命名,添加方案)。

"Now implemented as a branch + delete behind the scenes (new name is branched from the old, then the old name is deleted). This allows traceability in History, but allows us to get around the problems with merging renames (see Add, Rename, Add scenario). "


  1. 让所有开发人员合并(或放弃)Dev子分支中的所有安全更改。还要在重命名之前修剪所有不活动的分支。

  2. 阅读上述文章。

  3. 搜索以找到页面(我尚未找到),该页面根据实际经验准确地描述了用简单的术语会发生的情况。我想知道将Developset分支重命名为Main后,架子集会发生什么(下一步可以回答这个问题。)

  4. 您可以考虑制作一个沙盒团队项目(或Team Project Collection),然后尝试您的方案,看看是否存在重大问题。

  5. 选择正确的时间(请参阅链接1)并继续努力。

  6. 检查历史记录,在重命名的分支之间进行合并,然后再次检查历史记录。

  7. 允许开发人员重新登录。

  1. Get all devs to merge (or abandon) all safe changes in child branches of Dev. Also prune any inactive branches before the rename.
  2. Read above articles.
  3. Search to find the page (that I haven't found yet) that describes exactly what will happen in simpler terms based on real experience. Specifically I'd like to know what happens to shelvesets on the Develop branch after it is renamed to Main. (Next step can answer this.)
  4. You might consider making a "Sandbox" Team Project (or Team Project Collection) then try out your scenario to see if there are major issues.
  5. Pick right timing (see link#1) and go for it.
  6. Check history, do a merge between the renamed branches, check history again.
  7. Allow developers back in.

祝您好运,并发回任何新信息(包括您的最终结果)! -zs

这篇关于重命名分支,然后将名称重用于新分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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