简体   繁体   English

开发人员与发布分支 gitflow

[英]developer vs release branch gitflow

I'm new to gitflow so have a few questions.我是 gitflow 的新手,所以有几个问题。

Do we really need the developer branch?我们真的需要developer分支吗? What purpose does it serve?它的目的是什么?

We can very well have a master branch where everything gets merged to production level.我们可以很好地拥有一个master分支,其中所有内容都合并到生产级别。 Then for each release we have release branches which get deployed to production for release.然后对于每个版本,我们都有发布分支,这些分支被部署到生产中以进行发布。 Feature branches are where developers code and then with a pull request merge to the relevant release branch.功能分支是开发人员编写代码的地方,然后通过拉取请求合并到相关的发布分支。

What am I missing here?我在这里缺少什么?

What am I missing here?我在这里缺少什么?

To be blunt... everything .坦率地说……一切

You elect to use Git Flow to avoid messes with commits that you're not sure made their way into production, to keep accurate track of which commits are where, and to reduce the headache of everyone integrating everything into one branch at once with a lot of conflicts and missed assumptions.您选择使用 Git Flow 来避免与您不确定是否进入生产环境的提交混淆,准确跟踪哪些提交在哪里,并减少每个人将所有内容一次集成到一个分支中的麻烦冲突和遗漏的假设。

Let's start from the top:让我们从顶部开始:

Do we really need the developer branch?我们真的需要developer分支吗? What purpose does it serve?它的目的是什么?

In Git Flow proper, there are two branches proper:在 Git Flow 中,有两个适当的分支:

  • master掌握
  • develop发展

In this scenario, master contains code that is considered production ready.在这种情况下, master包含被视为生产就绪的代码。 If you had to, you could deploy the tip of master at any instant and you would be alright.如果有必要,你可以随时部署大师的尖端,你会没事的。 develop , or developer , is where the actual development happens; developdeveloper ,是实际开发发生的地方; there are things that need to be integrated here and tested together, so that's where this happens.有些东西需要在这里集成并一起测试,这就是发生这种情况的地方。 You want to do this here to insulate yourself from any bugs that may crop up.您希望在此处执行此操作,以使自己免受可能出现的任何错误的影响。

We can very well have a master branch where everything gets merged to production level.我们可以很好地拥有一个主分支,其中所有内容都合并到生产级别。 Then for each release we have release branches which get deployed to production for release.然后对于每个版本,我们都有发布分支,这些分支被部署到生产中以进行发布。

This means that the master branch serves only one role: it's an integration point.这意味着master分支只有一个角色:它是一个集成点。 You can no longer claim that master is production-ready code.您不能再声称master是生产就绪代码。


That said, Git Flow isn't for everyone.也就是说,Git Flow 并不适合所有人。 It may be the case that your master branch has a lot of really good regression tests that would allow you to commit directly to it, and you would be able to roll back in case of a disastrous release.可能你的master分支有很多非常好的回归测试,可以让你直接提交给它,并且你可以在灾难性的发布时回滚。

But, if you want to use Git Flow, you have to subscribe to the notion that work is tested on a separate integration branch before it's merged to master.但是,如果您想使用 Git Flow,您必须同意这样一种观念,即工作合并到 master之前在单独的集成分支上进行测试。

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

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