简体   繁体   中英

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

I'm learning Gitflow Workflow. The following is a sample diagram about Gitflow Workflow.

I think the the content of A, B, C and D are same,right?

I think that the A merger to C then C merger to D is OK, but why need C merger to B ? you know that A and B are same!

Image

在此输入图像描述

Your assertion that A, B, C, and D, are the same is incorrect (at least in the context of this diagram).

Between A and C, you will see that there are some commits. 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. 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.

This is documented on the original article about using GitFlow here:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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