简体   繁体   English

合并功能分支以释放分支而不是主干

[英]Merging feature branches to release branch instead of trunk

I have a question about two source control scenarios, both with feature branches and release branches: 我对两个具有功能分支和发布分支的源代码控制方案有疑问:

  • In scenario 1 feature branches are merged to the trunk. 在方案1中,功能分支合并到了主干。
  • In scenario 2 feature branches are merged to the latest release branch. 在方案2中,功能分支合并到最新版本的分支。

What are the consequences of scenario 2 compared to scenario 1? 与方案1相比,方案2的后果是什么?

What are the possible advantages and disadvantages of both scenarios? 这两种情况的可能优点和缺点是什么?


More details of the two scenarios: 两种情况的更多详细信息:

  • all development is done in feature branches 所有开发都在功能分支中完成
  • branching is always done from the trunk 分支总是从主干完成的

Scenario 1 (similar to what is described in this SO-answer ): 场景1(类似于此SO-answer中描述的场景):

  • feature branches are always merged to the trunk 功能分支始终合并到主干
  • a new release branch is created from the trunk, when preparations start for a new release 开始准备新版本时 ,将从主干中创建一个新的版本分支
  • after QA and deployment from a release branch, the changes/bugfixes in the release branch are merged to trunk and newer release branches 从发布分支进行质量检查和部署后,发布分支中的更改/错误修正将合并到主干和较新的发布分支中
  • changes to the trunk are merged to all feature branches 对主干的更改将合并到所有功能分支

Scenario 2: 方案2:

  • feature branches are always merged to the newest release branch 功能分支始终合并到最新版本的分支
  • a new release branch is created from the trunk, when the current release branch no longer accepts new features and preparations start for final release 当当前发行分支不再接受新功能并且开始准备最终发行时,会从主干创建一个新的发行分支
  • after QA and deployment from a release branch, the changes/bugfixes in the release branch are merged to trunk 从发布分支进行质量检查和部署后,发布分支中的更改/错误修正将合并到主干
  • changes to the trunk are merged to all feature branches and the newest release branch 对主干所做的更改将合并到所有功能分支和最新发布的分支中

Since branching is all about isolation (see " When should you branch ), the difference between the 2 scenarios is the role you want the main branch trunk to have : 由于分支完全是关于隔离的 (请参阅“ 何时分支” ),因此两种方案之间的区别是希望主分支trunk具有以下角色

  • Scenario 2 is more adapted to a static role : trunk would be the representation of what is in production (and the occasional hot-fixes needed to be merge back to current feature and next-release branch) 方案2更适合静态角色trunk将表示生产中的产品(偶尔需要将修补程序合并回当前功能和下一发行版分支)

  • Scenario 1 is more suited for a dynamic role : trunk is the integration for various feature, release branches being made from there to consolidate the features which will actually be part of the next release. 场景1更适合于动态角色trunk是各种功能的集成,从那里创建了发布分支以合并功能,这些功能实际上将成为下一版本的一部分。

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

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