简体   繁体   English

是否有一个gitflow进程用于分支和错误修复与发布分支?

[英]Is there a gitflow process for branching and bug fixes with a release branch?

In order to have make sure all code eventually goes through pull request code review, we've started creating branches for features and bug branches off of develop following the git-flow style . 为了确保所有代码最终都通过pull请求代码审查,我们已经开始按照git-flow风格创建功能和bug分支的分支。

The only problem is that once a bug is found in a release branch, we often have to make a branch off of the release branch in order to do a pull request back to the release branch. 唯一的问题是,一旦在发布分支中发现错误,我们通常必须从发布分支创建一个分支,以便将pull请求发送回发布分支。 But there doesn't seem to be an obvious git-flow process for handling branches off of the release branch when bug fixing a release branch. 但是当bug修复发布分支时,似乎没有明显的git-flow进程来处理发布分支的分支。

What is the git-flow process for fixing release branch bugs and code review? 什么是用于修复发布分支错误和代码审查的git-flow流程?

Are you supposed to fix the bug in develop and create a new release branch? 您是否应该修复开发中的错误并创建新的发布分支? Is branching off of a release branch still valid git-flow? 分支发布分支仍然是有效的git-flow? What's the best way to handle pull request code reviews on release branch bug fixes? 在发布分支错误修复上处理拉取请求代码审查的最佳方法是什么?

I just came accross this same issue. 我刚刚遇到同样的问题。 I suggest creating a normal branch from the release branch. 我建议从发布分支创建一个普通的分支。 Make your fixes there and create a pull request for that branch to be merged to the release branch. 在那里进行修复并为该分支创建一个pull请求以合并到release分支。 This is using the normal branch and merge commands and not the Git Flow commands. 这是使用普通的分支和合并命令,而不是Git Flow命令。

Step details below: 步骤详情如下:

  1. checkout the release/2017.05.24 branch. 结帐发布/ 2017.05.24分支。 Where 2017.05.24 is the name of the release branch. 2017.05.24是发布分支的名称。
  2. Execute the branch command and name it “release2017.05.24 - reason for fix”. 执行branch命令并将其命名为“release2017.05.24 - 修复原因”。 This will make it obvious why the branch exists (for release fix). 这将显示分支存在的原因(对于发布修复)。
  3. Make your changes, commit, push your changes up to the server (push your branch to origin). 进行更改,提交,将更改推送到服务器(将分支推送到源)。
  4. In your server create a pull request for your branch to merge to the release/2017.05.24 branch. 在您的服务器中,为您的分支创建一个pull请求以合并到release / 2017.05.24分支。 NOTE: merging to release/2017.05.24 branch is NOT the default so be sure to change that before creating the pull request. 注意:合并到发布/ 2017.05.24分支不是默认值,因此请务必在创建拉取请求之前更改它。
  5. On code review approval checkout “release/2017.05.24” 在代码审查批准结帐“发布/ 2017.05.24”
  6. Execute the merge command picking your commit in “release2017.05.24 -reason for fix” branch. 在“release2017.05.24 -reason for fix”分支中执行合并命令选择提交。
  7. Delete the local and remote branches for your “release2017.05.24 - reason for fix” branch 删除“release2017.05.24 - 修复原因”分支的本地和远程分支

Hopefully that will work better. 希望这会更好。 Lots of steps and brakes from the Git-flow command set but should allow the pull requests to happen. Git-flow命令集中有很多步骤和制动,但应该允许拉取请求发生。

The way I handle it would be to have a hotfix branch off the release branch. 我处理它的方式是在发布分支上有一个修补程序分支。 After fixing the bug I would merge in to master/release branch and also merge to Dev branch which would then trickle down to the other features. 修复错误后,我将合并到master / release分支,并合并到Dev分支,然后逐渐渗透到其他功能。

The hotfix would then be deleted because it'll be recorded in master or dev . 然后将删除此修补程序,因为它将记录在masterdev

Bug fix branches should be branched off master (or whatever branch represents your production code). 错误修复分支应该分支主(或任何分支代表您的生产代码)。 If you're using git flow, this sometimes means you have to cherry pick commits into the bug fix branch if you've already made the code change in a branch off of develop. 如果您正在使用git flow,这有时意味着如果您已经在开发分支中进行了代码更改,那么您必须选择提交到错误修复分支。

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

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