简体   繁体   English

为什么需要在 GitFlow 中开发分支

[英]Why need Develop Branch in GitFlow

We know git-flow like this我们知道 git-flow 是这样的在此处输入图片说明 Source: Vincent Driessen资料来源:文森特·德里森

I don't know why need develop branch, what probles will cause without develop branch ?why not merage feature branches to release branches directly?不知道为什么需要develop分支,没有develop分支会导致什么问题?为什么不合并功能分支直接发布分支呢?

Actually, I wouldn't say that the given answer properly explains, why the develop branch and the master branch are both needed to achieve a releasable state.实际上,我不会说给出的答案正确解释了为什么需要开发分支和主分支来实现可发布状态。 The version tags created on each release also reflect the releasable state and in Git you can always create a new branch based on these tags subsequently if needed.在每个版本上创建的版本标签也反映了可发布状态,并且在 Git 中,如果需要,您始终可以随后根据这些标签创建一个新分支。

In fact, there are multiple blog posts that criticize the Git Flow model and propose a more convenient branching model, which only uses one main branch, ie the "master".事实上,已有多篇博文批评Git Flow 模型并提出了一种更方便的分支模型,该模型只使用一个主分支,即“master”。 Here are the references:以下是参考资料:

https://reallifeprogramming.com/git-process-that-works-say-no-to-gitflow-50bf2038ccf7 https://www.endoflineblog.com/gitflow-considered-harmful https://reallifeprogramming.com/git-process-that-works-say-no-to-gitflow-50bf2038ccf7 https://www.endoflineblog.com/gitflow-thinked-harmful

Thus, the actual answer to this question should be: You don't necessarily need the develop branch if you adapt your workflow as described in the linked posts.因此,这个问题的实际答案应该是:如果您按照链接帖子中的描述调整工作流程,则不一定需要开发分支。 Still, you wouldn't merge your features into the release branches, but to the master branch, as you want them to be available in the future versions as well.尽管如此,您不会将您的功能合并到发布分支,而是合并到主分支,因为您希望它们在未来版本中也可用。

you can not release everytime you develop a new feature, you make a release when the the develop branch is in a 'releasable' state.你不能在每次开发新功能时发布,当开发分支处于“可发布”状态时,你会发布一个版本。 ie the end user can accualy use that version.即最终用户可以准确地使用该版本。 So the master branch reflects releases and hot fixes whcih can be used by the end user.所以主分支反映了最终用户可以使用的版本和热修复。 in other words, the master head is always a release which can be used, you can not get that without the develop branch.换句话说,master head 总是一个可以使用的版本,没有 develop 分支你就无法得到它。

Vincent Driessen wrote:文森特·德里森写道:

We consider origin/master to be the main branch where the source code of HEAD always reflects a production-ready state.我们认为 origin/master 是 HEAD 源代码始终反映生产就绪状态的主要分支。

We consider origin/develop to be the main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release.我们认为 origin/develop 是主分支,其中 HEAD 的源代码始终反映下一个版本最新交付的开发更改的状态。 Some would call this the “integration branch”.有些人将其称为“集成分支”。 This is where any automatic nightly builds are built from.这是构建任何自动夜间构建的地方。

you can get all of the original post here你可以在这里得到所有的原始帖子

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

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