简体   繁体   English

gitflow单独合并发行分支以进行发展

[英]gitflow merging release branches separately to mater and develop

Background: 背景:

Git flow suggests to merge the release branch into master and development branches separately. Git流建议将release分支分别合并到master分支和development分支。 In my view this will create separate merge commits in both the branches and the development branch will never get the commit of master and will be in sync. 在我看来,这将在两个分支中创建单独的合并提交,而development分支将永远不会获得master的提交,并且将同步。

My question is, does git flow expect to run in parallel with respect to the files committed and never sync with each other in respect to their individual commits? 我的问题是,git flow是否期望相对于已提交的文件并行运行,并且从不就其各自的提交彼此同步?

or 要么

what is the reason behind having separate commits in both branches? 在两个分支中进行单独提交的背后原因是什么?

The master branch is usually never merged back into develop . master分支通常永远不会合并回develop Thus, merge commits from master will never be merged back into develop . 因此,来自master合并提交将永远不会被合并回develop The merge commit in develop , of course, will be merged into master with the next release branch. 当然, develop的合并提交将与下一个发行分支合并为master。

By definition, a release branch has to be merged into master (you do want to release it, after all). 根据定义,发布分支必须合并到master中(毕竟您确实要发布它)。 Since it contains changes that are not in develop (and these changes have no other way to make it to develop , see above), there is no alternative to also merging it back into develop . 由于它包含尚未develop更改(并且这些更改没有其他方法可以使其进行develop ,请参见上文),因此没有其他选择可以将其重新合并到develop

So, as you see, there is no alternative to merging the release branch two times. 因此,如您所见,没有什么办法可以合并两次发布分支。 This should, however, not be a problem. 但是,这应该不是问题。 If by out of sync you mean that master contains commits that develop does not, ie merge commits, you're right. 如果out of sync您的母版包含开发中未提交的提交,即合并提交,那您是对的。 But that's usually no problem. 但这通常没问题。

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

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