将主变更合并到已发布的功能分支中 [英] merging changes from master into a published feature branch

查看:152
本文介绍了将主变更合并到已发布的功能分支中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有多个开发人员在功能分支上工作,并且我们需要定期从主服务器引入更改,则可以使用以下两种方法:


  1. 开发人员表示他们有来自已发布功能部门的最新更改。然后,一名开发人员重新加入主人并强行推动。其他开发人员关闭新功能分支,每个人都继续开发。

  2. 任何开发人员只要他们喜欢就会合并主人,没有人会强制推送。 >

    我的问题:


    1. 我是对的,这些是可能的工作流程吗?

    2. 与第二个工作流相关联,当需要将功能分支引入主设备时,如何使用最简洁的历史记录完成这项工作?将一个重新绑定到master清理/删除其他合并提交,或将它一团糟?


    解决方案


    1. 是的。

    2. 是的,除非你使用--preserve-merge选项重新绑定,那些合并提交仍然存在,但没有 master 中的任何父项。

    我倾向于采用第一种方法,因为:


    • 它确实在开发团队内部进行沟通

    • 它避免了back-merge(从 master 到一个功能分支)

    • 它并不要求您在最终重新绑定期间想要保留的那些合并提交。

    • 它有助于将该特性分支最终集成到主
    • li>

    If there are multiple developers working on a feature branch, and we need to periodically bring in changes from master, there are two approaches that I know of:

    1. developers communicate that they have the latest changes from the published feature branch. Then one developer rebases onto master and force pushes. Other developers pull down the new feature branch and everyone continues developing.
    2. any developer merges master in whenever they like, no one ever force pushes.

    my questions:

    1. am i right that these are the possible workflows?
    2. with the second workflow, when it's time to bring the feature branch into master, how can this be done with the cleanest history possible? Will a rebase onto master clean up/remove the other merge commits, or will it be a mess?

    解决方案

    1. Yes.

    2. yes, unless you rebase with the --preserve-merge option, those merge commit would still be there, but without any parent on master.

    I tend to favor the first approach because:

    • it does enforce communication within the dev team
    • it avoids "back-merge" (from master to a feature branch)
    • it doesn't require those merge commit from master that you would want to keep during a final rebase.
    • it facilitates the final integration of that feature branch into master

    这篇关于将主变更合并到已发布的功能分支中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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