简体   繁体   English

将变更从master合并到已发布的功能分支中

[英]merging changes from master into a published feature branch

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: 如果有多个开发人员在功能分支上工作,并且我们需要定期从master进行更改,那么我知道有两种方法:

  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. 任何开发人员只要愿意就可以将master合并进来,没有人强迫执行。

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 . 是的,除非您使用--preserve-merge选项进行变基 ,否则那些合并提交仍将存在,但是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) 它避免了“后合并” (从master到Feature分支)
  • it doesn't require those merge commit from master that you would want to keep during a final rebase. 它不需要您希望在最终重新定级期间保留的来自master的那些合并提交。
  • it facilitates the final integration of that feature branch into master 它有助于将该功能分支最终集成到master中

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

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