简体   繁体   English

执行功能合并后,我们应该删除分支,还是稍后合并?

[英]After performing a feature merge, are we supposed to delete the branch, or merge back later?

Using TFS, but the question seems appropriate for any version control system. 使用TFS,但问题似乎适合任何版本控制系统。

In the following scenario I created a local folder named dev\\1\\< project > next to the main folder for feature 1 development as a branch off of the main. 在下面的场景中,我在main文件夹旁边创建了一个名为dev\\1\\< project >的本地文件夹,作为main的分支。 I merged it back when feature 1 was completed. 当功能1完成时,我将其合并。

When it comes time to work on feature 4, should I merge the main back to the feature 1 folder (branch) and use it for feature 4 work, or as the picture below portrays, should I delete the feature 1 folder and simply create another folder to branch with for feature 4? 当需要处理功能4时,我应该将主要功能合并到功能1文件夹(分支)并将其用于功能4工作,或者如下图所示,我应该删除功能1文件夹并简单地创建另一个要为功能4分支的文件夹? Or is it no real difference? 或者它没有真正的区别? Perhaps there are practical issues not immediately apparent? 也许有些实际问题不会立即显现出来?

在此输入图像描述

Picture taken from Professional Team Foundation Server 2013 , St. Jean et al 图片来自Professional Team Foundation Server 2013St. Jean et al

When using Feature Branching methodology I prefer to delete the "closed" branch, and take a new one. 使用特征分支方法时,我更喜欢删除“已关闭”分支,并采用新分支。

I do this for three reasons: 我这样做有三个原因:

  • I can name the branch to something that is relevant to the feature being worked on 我可以将分支命名为与正在处理的功能相关的内容
  • Removes any potential merge conflicts (and therefore reduces risk of regressions) 消除任何潜在的合并冲突(从而降低回归风险)
  • It's entirely possible that multiple features will be worked on simultaneously and this should be done in separate branches to allow isolation. 完全可能同时处理多个功能,这应该在单独的分支中完成以允许隔离。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM