为什么我使用GitFlow时需要将release分支合并到develop分支?
Why does the release branch need to be merged into develop branch when I use GitFlow?
我正在学习 Gitflow 工作流。下面是关于Gitflow Workflow的示例图。
我觉得A、B、C、D的内容是一样的吧?
我觉得A合并C再C合并D是可以的,但是为什么要C合并B呢?你知道A和B是一样的!
图片
您关于 A、B、C 和 D 相同的断言是不正确的(至少在此图的上下文中是这样)。
在A和C之间,你会看到有一些commit。这是意料之中的。虽然 "testing" 发布分支,但可能发现了一些需要在发布前更正的错误。或者可能需要进行一些维护工作,例如,更新源代码中的版本号等。
无论哪种方式,都是在发布分支上进行更改,因此,一旦完成,这些更改必须返回到开发分支中,以便它们可以进入下一个版本。
现在,说了这么多,有时可能没有对发布分支进行额外的更改,因此,没有必要合并回开发分支。在这些情况下,如果您尝试将发布分支合并回开发分支,git 实际上会告诉您无事可做,因此不会发生合并。
这里记录了关于使用 GitFlow 的原始文章:
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. 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.
我正在学习 Gitflow 工作流。下面是关于Gitflow Workflow的示例图。
我觉得A、B、C、D的内容是一样的吧?
我觉得A合并C再C合并D是可以的,但是为什么要C合并B呢?你知道A和B是一样的!
图片
您关于 A、B、C 和 D 相同的断言是不正确的(至少在此图的上下文中是这样)。
在A和C之间,你会看到有一些commit。这是意料之中的。虽然 "testing" 发布分支,但可能发现了一些需要在发布前更正的错误。或者可能需要进行一些维护工作,例如,更新源代码中的版本号等。
无论哪种方式,都是在发布分支上进行更改,因此,一旦完成,这些更改必须返回到开发分支中,以便它们可以进入下一个版本。
现在,说了这么多,有时可能没有对发布分支进行额外的更改,因此,没有必要合并回开发分支。在这些情况下,如果您尝试将发布分支合并回开发分支,git 实际上会告诉您无事可做,因此不会发生合并。
这里记录了关于使用 GitFlow 的原始文章:
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. 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.