简体   繁体   English

当我使用GitFlow时,为什么需要将发布分支合并到develop分支中?

[英]Why does the release branch need to be merged into develop branch when I use GitFlow?

I'm learning Gitflow Workflow. 我正在学习Gitflow工作流程。 The following is a sample diagram about Gitflow Workflow. 以下是有关Gitflow工作流的示例图。

I think the the content of A, B, C and D are same,right? 我认为A,B,C和D的内容是一样的,对吧?

I think that the A merger to C then C merger to D is OK, but why need C merger to B ? 我认为A合并到C然后C合并到D是可以的,但为什么需要C合并到B? you know that A and B are same! 你知道A和B是一样的!

Image 图片

在此输入图像描述

Your assertion that A, B, C, and D, are the same is incorrect (at least in the context of this diagram). 您断言A,B,C和D是相同的是不正确的(至少在此图的上下文中)。

Between A and C, you will see that there are some commits. 在A和C之间,您将看到有一些提交。 This is expected. 这是预料之中的。 While "testing" the release branch, it could be that there were some bugs identified which needed to be corrected prior to publishing. 在“测试”发布分支时,可能会发现在发布之前需要纠正的一些错误。 Or it could be that there was some maintenance work required, for example, updating a version number in source code, or similar. 或者可能需要进行一些维护工作,例如,更新源代码中的版本号或类似的。

Either way, changes are being made on the release branch, and as such, once completed, those changes have to be brought back into the develop branch, so that they can move forward into the next release. 无论哪种方式,都会在发布分支上进行更改,因此,一旦完成,这些更改必须返回到开发分支,以便它们可以继续进入下一个版本。

Now, having said all of that, there can be times when there are no additional changes made on the release branch, and as a result, a merge back into the develop branch is unnecessary. 现在,已经说过所有这些,有时候在发布分支上没有进行其他更改,因此,不需要合并回develop开发分支。 In these situations, if you attempt to merge the release branch back into the develop branch, git will actually tell you that there is nothing to do, and as a result, no merge will happen. 在这些情况下,如果您尝试将发布分支合并回开发分支,git实际上会告诉您没有任何操作,因此不会发生合并。

This is documented on the original article about using GitFlow here: 这是关于在这里使用GitFlow的原始文章中记录的:

https://nvie.com/posts/a-successful-git-branching-model/#release-branches https://nvie.com/posts/a-successful-git-branching-model/#release-branches

Release branches support preparation of a new production release. 发布分支支持准备新的生产版本。 They allow for last-minute dotting of i's and crossing t's. 他们允许最后一刻点缀我和交叉t。 Furthermore, they allow for minor bug fixes and preparing meta-data for a release (version number, build dates, etc.). 此外,它们允许修复小错误并为发布准备元数据(版本号,构建日期等)。 By doing all of this work on a release branch, the develop branch is cleared to receive features for the next big release. 通过在发布分支上完成所有这些工作,开发分支将被清除以接收下一个大版本的功能。

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

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