在gitflow模型中创建修补程序分支或功能分支 [英] Create a hotfix branch or a feature branch in gitflow model

查看:118
本文介绍了在gitflow模型中创建修补程序分支或功能分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在团队中使用此模型:

今天我的项目统计如下:

  • 稳定版正在使用master分支在生产中运行
  • 我们开发了需要在生产之前进行测试的新功能,因此我们有一个发布分支正在 SIT环境下进行测试.在SIT环境中进行所有测试后,可以将这些新功能与master合并.

问题:产品负责人请求在生产"表中添加新字段.因此,团队提出了两种解决方案:

  • 从master创建一个修补程序分支,添加新字段并部署到测试环境.此修补程序可能要等上几个月才能与母版合并,因为在测试通过之后,我们需要等待产品负责人说可以投入生产,因为此字段取决于另一个系统更改. /p>

  • 从开发创建功能分支,并添加此新字段并部署到测试环境. 我认为这是最糟糕的解决方案,因为我正在开发的东西无法合并到母版中,因此我将需要一个樱桃采摘来仅拾取所需的更改从发行到掌握.请记住,团队正在验证 SIT环境(发布分支)中的其他功能.

解决方案

如果我从developer分支创建功能,那么我将获得不应该在此新功能分支中投入生产的功能.记住,我还不能将开发内容发送到生产中

不高兴,最大的问题不是合并,而是无法掌握的功能.我如何只发送此更改,而又不发送开发或发行分支中的所有其他功能?

这意味着gitflow不是适合您的工作流程.
切换到 gitworkflow (一个词, rocketraman/gitworkflow 中查看更多信息.

这种工作流程(您不将dev合并到master,但是仅将功能分支合并到dev,然后如果选择了,则合并到master,以便能够删除可以在Git存储库中轻松实现功能分支,而这些功能分支尚未为下一个版本做好准备.

(来源: Gitworkflow:面向任务的入门书)

您有:

  • master是随时可以部署到生产中的分支:下一个版本,其中选定的一组功能分支合并在master中.
  • dev(或集成分支或"next")是一起测试为下一版本选择的功能分支的
  • maintenance(或hot-fix)分支是当前版本演进/错误修复的分支,可能合并到dev和或master

注意:在该分布式工作流中,您可以随时提交并向个人分支推送一些WIP(进行中的工作)而不会出现问题:您将能够重新组织(git rebase)提交,然后再将它们纳入功能分支.

I'm using this model in my team:

Today my project stats is following:

  • The stable version is running in production using master branch
  • We developed new functionalities that need to be tested before production, so we have a release branch be testing under SIT Environment. This new functionalities just can be merged with master after all tests in SIT Environment.

The problem: The Product Owner requested a new field in a Table in Production. So the team suggest two solutions:

  • Create a hotfix branch from master , add the new field and deploy to a Test Environment. This hotfix can wait months until merge with master, because after test pass we need wait the Product Owner say that can go to production because this field depends on another system changes.

  • Create a feature branch from develop and add this new field and deploy to a Test Environment. I think this is worst solution because i have things in develop that can't be merged to master, so i will need a cherry-pick to pick-up only desired changed from release to master. Remember that team is validating others functionalities in SIT Environment (release branch).

解决方案

If I create feature from develop branch I will got functionalities that don't should go to production in this new feature branch. Remember that I can't send develop to production yet

Unhappy the big problem is not merge but the functionalities that can't go to master. How can I send only this change without send all other features inside a develop or release branch?

That means gitflow is not the workflow for you.
Switch to the gitworkflow (one word, illustrated here).
See more at rocketraman/gitworkflow.

That kind of workflow (where you don't merge dev to master, but where you merge only feature branch to dev, then if selected, to master, in order to be able to drop easily feature branches not ready for the next release) is implemented in the Git repo itself.

(source: Gitworkflow: A Task-Oriented Primer)

You have:

  • master is the branch ready to be deployed into production at any time: the next release, with a selected set of feature branches merged in master.
  • dev (or integration branch, or 'next') is the one where the feature branch selected for the next release are tested together
  • maintenance (or hot-fix) branch is the one for the current release evolution/bug fixes, with possible merges back to dev and or master

Note: in that distributed workflow, you can commit whenever you want and push to a personal branch some WIP (Work In Progress) without issue: you will be able to reorganize (git rebase) your commits before making them part of a feature branch.

这篇关于在gitflow模型中创建修补程序分支或功能分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆