git流释放选定的功能 [英] git flow releasing selected features

查看:183
本文介绍了git流释放选定的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Git流引入我的团队。我们是一个相当小的团队,而且非常敏捷。我们希望每天发布一次,这意味着我们有限的时间来测试当天的所有更改。业务团队希望能够控制即将发布的功能,尽管它并不理想。

Git流程似乎并不适应这一点。在将发布分支从开发中切分之后,将所选功能合并到主控的最佳方式是什么。樱桃采摘是唯一的选择吗?有没有更好的方法?

解决方案

标准 git flow 如果业务团队想要控制下一个版本中的哪些功能,那么这并不理想。但是你会遇到与其他分支机制相同的问题。

git flow 的默认结构是为每个新特性创建一个特性分支。完成构建(并测试)新功能后,将分支合并回开发分支,然后删除功能分支。然后该功能将包含在下一个版本中。



如果某个功能不应包含在下一个版本中,则不应将功能分支合并回开发分支。这是确保它不会被包含在内的最好方法。它还可以防止其他开发人员创建使用(或以其他方式需要)新功能的代码。



我不推荐樱桃采摘。首先,一个功能可以(并且经常会)有多个提交,并且很容易忘记。其次,如果功能B使用在功能A中添加的代码,并且管理层希望在不释放功能A的情况下释放功能B,则可能会发现功能B已损坏。这些依赖性并不总是很容易被发现。

管理层想要优先考虑新功能是有道理的,但是每个功能都应该在开发分支后不久合并回开发分支已经完成(并经过测试)。

I am trying to introduce Git flow to my team. We are a fairly small team and quite agile. We want to release once a day and this means we have limited time towards testing all the changes in the day. Business team wants to be able to control the features that are getting released although its not ideal.

Git flow doesn't seem to accommodate this very well. After cutting a release branch from develop what is the best way to merge selected features to master. Is cherry picking the only option? Is there a better way?

解决方案

The standard git flow handling is not ideal if the business team wants to control which features are in the next release. But you will have the same problem with other branching mechanisms.

The default structure for git flow is that you create a feature branch for each new feature. Once you have finished building (and testing) the new feature, you merge the branch back into your develop branch and then remove the feature branch. Then the feature will be included in the next release.

If a feature should not be included in the next release, you should not merge the feature branch back into the develop branch. That is the best way to make sure it will not be included. It also prevents other developers from creating code that uses (or otherwise requires) the new feature.

I would not recommend cherry-picking. First, a feature can (and frequently will) have multiple commits and it is easy to forget one. Second, if feature B uses code that was added in feature A, and management wants to release feature B without releasing feature A, you're likely to find that feature B is broken. And those dependencies are not always easy to spot.

It makes sense that management wants to prioritize new features, but each feature should be merged back into the develop branch soon after it has been completed (and tested).

这篇关于git流释放选定的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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