简体   繁体   English

Gitflow:将发布错误修复合并回主开发

[英]Gitflow: Merging release bugfixes back to develop from master

My question is around a very specific point in the gitflow process (as documented here ).我的问题是围绕 gitflow 过程中的一个非常具体的点(如此处所述)。

I've already merged bugfixes from release/1.2 into master , and tagged appropriately.我已经将release/1.2错误修正合并到master ,并进行了适当的标记。

Apart from how the history looks, what are differences between back-merging from release/1.2 vs back-merging from master into develop .除了历史看起来如何,从release/1.2回合并与从master回合并到develop之间有什么区别。

I have tried both ways, and in my simple, contrived example I see no difference in develop , as I expected.我已经尝试了两种方法,在我简单、人为的示例中,正如我所料,我发现develop没有区别。

Are there dangers to this?这有危险吗? Am I going to encounter messy issues later on?我以后会遇到麻烦的问题吗? Am I missing something obvious?我错过了一些明显的东西吗? I suspect the answer may be to do with other features that have gone into master , but which should remain out of develop for the moment.我怀疑答案可能与已进入master其他功能有关,但目前应该不在develop中。

merging release in to develop:合并发布以开发:

在此处输入图片说明

merging master in to develop:合并主开发:

在此处输入图片说明

If you merge master back into your develop, you will have all the merge branch release/xy into master merge commits in your develop branch, while when merging the release/xy branch itself, you only get the real changes.如果您将master合并回您的 develop,您将在您的 develop 分支中将所有merge branch release/xy into master合并merge branch release/xy into master合并提交中,而在合并release/xy分支本身时,您只会获得真正的更改。

Of course, this is more or less a cosmetic issue.当然,这或多或少是一个表面问题。 But the merge direction is usually only from develop to master , never the other way around.但是合并方向通常只是从developmaster ,而不是相反。

There are no real dangers except for said merge commits cluttering up your develop branch.除了上述合并提交使您的develop分支混乱之外,没有真正的危险。 If you stick to the flow, there should never be features in master that are not in develop , since hot fixes as well as release branches should always be merged into your develop as well as in master .如果您坚持流程,那么master中永远不应该有不在develop ,因为热修复和发布分支应该始终合并到您的developmaster

I suspect the answer may be to do with other features that have gone into master , but which should remain out of develop for the moment.我怀疑答案可能与已进入master其他功能有关,但目前应该不在develop中。

Commits from master go into develop with next hotfix merge anyway.无论如何, master提交都会进入下一个修补程序合并的develop If there were real code change, it could be unexpected outcome and distort the hostfix content.如果有真正的代码更改,可能会出现意外结果并扭曲主机修复内容。

Merging stable branch ( master in gitflow) into development branch ( develop in gitflow) is known way in various git workflows.合并稳定分支( master在gitflow)进入开发分支( develop中gitflow)是已知的各种git的工作流的方式。 Bbitbucket Server (commercial solusion being sold by Atlassian) has a feature of Automatic branch merging . Bbitbucket Server(Atlassian 出售的商业解决方案)具有自动分支合并的功能。 Git project itself always merges branch maint into master as there is some bugfix.由于存在一些错误修复,Git 项目本身总是将分支maint合并到master中。

So I don't really see the reason why gitflow's author has chosen another way.所以我真的不明白 gitflow 的作者选择另一种方式的原因。 It might be that there is no real rationale, it was just an accidental decision.可能没有真正的理由,这只是一个偶然的决定。

Are there dangers to this?这有危险吗? Am I going to encounter messy issues later on?我以后会遇到麻烦的问题吗? Am I missing something obvious?我错过了一些明显的东西吗?

No dangers;没有危险; no issues;没有问题; and you're not missing anything.你不会错过任何东西。 Merging master back to develop is (IMHO) the slightly better way to go, and there are no downsides.master合并回develop是(恕我直言)稍微好一点的方法,并且没有缺点。 Either way you choose you will always end up with the same total number of merge commits in develop .无论您选择哪种方式,您最终都会在develop获得相同的合并提交总数。 The difference is only the timing of when those merge commits end up there.区别仅在于这些合并提交何时结束。 If you merge release back first you don't get all of the release to master merge commits until later, all in one shot when you do a hotfix.如果合并release回来第一你没有得到全部的release ,以master ,当你做了修补程序合并提交,直到后来,所有在一杆。 If you do master back to develop you see the recent merge commits right away.如果您重新master develop您会立即看到最近的合并提交。 But there's an even bigger advantage of merging master back to develop :但是将master合并回develop有一个更大的优势:

At all times it's important to make sure all changes in master are also in develop or in release when it exists.在任何时候,确保master中的所有更改在存在时也在developrelease很重要。 (The only time they should ever be out of sync is during the completion of a release or hotfix branch.) Perhaps the easiest way to confirm master is synced up is to make sure the tip (top commit) in master is always in develop , or release when it exists. (唯一的一次,他们应该永远是不同步的是完成时releasehotfix的分支。)也许,以确认最简单的方法master的同步增长是确保尖端(上提交)在master总是在develop ,或在它存在时release You could easily script that to run at some regular frequency and notify you if it's not true.您可以轻松编写脚本以定期运行,并在不正确时通知您。 That script is more complicated if you can't expect the tip commit of master to ever be in release .如果您不能期望master的提示提交永远在release那么该脚本会更加复杂。

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

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