简体   繁体   English

在gitflow中,如果我们有一个发布分支开放了一个星期,我们仍然可以将功能分支合并到开发中吗

[英]In gitflow if we have a release branch open for one week can we still merge feature branches into develop

In gitflow if we have a release branch open for one week can we still merge feature branches into develop. 在gitflow中,如果我们有一个开放的发行分支一个星期,我们仍然可以将功能分支合并到开发中。

We have a release branch open for a while because we do the cut off from develop and we keep the release branch open for one week. 我们有一个发布分支开放了一段时间,因为我们切断了开发的工作,并且将发布分支保持了一周的开放时间。 But at the same time we need to merge things back to develop. 但是同时我们需要将事物合并回去进行开发。 Is that correct? 那是对的吗? or we should do it in another branch temporally or release branch should not be open for so long? 还是我们应该暂时在另一个分支中这样做,或者发布分支不应该打开这么长时间? any thoughts? 有什么想法吗?

Once you create a release branch from develop, everything that gets committed or merged to develop is basically for the next release. 一旦从development创建了发布分支,提交或合并以进行开发的所有内容基本上都将用于下一个版本。

Imagine your current release is 1.0 (so master is on 1.0 ) and you have finished implementing features for 1.1 in develop . 想象一下你目前的版本是1.0 (所以master1.0 ),你已经完成实现的功能为1.1develop You then branch release off of develop an increase the version number there to 1.1 . 然后,您将分支的release develop为将版本号增加到1.1 From this time on all changes that go to develop are for version 1.2 . 从那时起,所有要develop更改都针对1.2版。 If you need to fix stuff for release 1.1 , do it on the release branch. 如果您需要修复1.1 ,请在release分支上进行。 However, it should be only small, polishing changes ideally. 但是,它应该很小,理想情况下会进行抛光更改。 If you fear that these changes may interfere too much with the parallel development for 1.2 that simultaneously takes place on develop , you may also introduce these changes also in develop and any feature branch that is still being developed on. 如果你担心这些变化可能过多干预与并行开发1.2是同时进行的develop ,你也可能引入这些变化也在发展,并且目前仍在开发中的任何特性分支。 Depending on the changes you can do so by either merging release to develop or by cherry-pick ing individual commits. 根据更改,可以通过合并release来进行develop也可以通过cherry-pick单个提交来实现。 You may want to read how to merge a specific commit in Git and also the differences in Git Cherry-pick vs Merge Workflow . 您可能想阅读如何在Git中合并特定的提交,以及Git Cherry-pick vs Merge Workflow中的差异。

Personally I don't see any problem with merging the version number change from release to develop before all work on release is finished. 就个人而言,在完成所有release工作之前,合并从releasedevelop的版本号更改没有任何问题。 I would just make sure that my merge comment clearly tells that this is not the final merge but some intermediate one. 我只是要确保我的合并注释清楚地表明这不是最终合并,而是一些中间合并。

At the end one should keep in mind that git flow is only a measure to help developers organize their work. 最后,应该记住git flow只是帮助开发人员组织其工作的一种措施。 One should not make it a daily struggle to follow it strictly if in the end it does not fit the teams internal workflow. 如果最终它不适合团队内部工作流程,则不应使每天都要严格遵循它。

Also see Vincent Driessen's blog post that introduced git flow and a (slightly opinionated) comparison of different branching models by Atlassian . 另请参阅Vincent Driessen的博客文章,该文章介绍了git flow以及Atlassian对不同分支模型的(略带观点的) 比较

在此处输入图片说明

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

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