Gitflow: Merging release bugfixes back to develop from master

风格不统一 提交于 2020-01-04 06:46:45

问题


My question is around a very specific point in the gitflow process (as documented here).

I've already merged bugfixes from release/1.2 into master, and tagged appropriately.

Apart from how the history looks, what are differences between back-merging from release/1.2 vs back-merging from master into develop.

I have tried both ways, and in my simple, contrived example I see no difference in develop, as I expected.

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.

merging release in to develop:

merging master in to develop:


回答1:


If you merge master back into your develop, you will have all the merge branch release/x.y into master merge commits in your develop branch, while when merging the release/x.y branch itself, you only get the real changes.

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.

There are no real dangers except for said merge commits cluttering up your develop branch. 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.




回答2:


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.

Commits from master go into develop with next hotfix merge anyway. 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. Bbitbucket Server (commercial solusion being sold by Atlassian) has a feature of Automatic branch merging. Git project itself always merges branch maint into master as there is some bugfix.

So I don't really see the reason why gitflow's author has chosen another way. It might be that there is no real rationale, it was just an accidental decision.



来源:https://stackoverflow.com/questions/46604715/gitflow-merging-release-bugfixes-back-to-develop-from-master

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!