如何挑选/重组/解决冲突的最终结果 [英] How to cherry-pick/rebase/etc the end result of conflict resolve

查看:92
本文介绍了如何挑选/重组/解决冲突的最终结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下情况:
我们有以下分支:


  • A这是我们的旧基线

  • B这是我们的新基线

  • C在A之上开发了新变更
  • D开发合并B和C,并在这里解决冲突



现在,我们需要修改和重新绑定D.
上的某些提交,因为rebase使用提交本身(而不是解析的最终结果),它看起来像我们必须再次解决冲突。



有没有办法(重新)工作在提交的D,而不需要解决相同的冲突?

解决方案

我认为你正在寻找 git rebase --preserve-merges 。如果没有这个选项,它会忽略原始的合并提交,只是提交非合并提交,让你解决一些已经完成的合并冲突。



参考: git的rebase --preserve-merges究竟是什么?做(为什么?)


Consider the following situation: We have the following branches:

  • A Which is our old baseline
  • B Which is our new baseline
  • C Which has new changes developed on top of A
  • D Which is developed merging B and C, and conflicts are resolved here

Now, we need to modify and rebase some commits on D. But, because rebase uses the commits per se (and not the end result of the resolve), it looks like we have to resolve the conflicts again.

Is there any way to (re)work on commits of D without need to solve the same conflicts?

解决方案

I think you're looking for git rebase --preserve-merges. Without this option, it ignores the original merge commits and just commits the non-merge commits, leaving you to resolve some merge conflicts that were already done.

Reference: What exactly does git's "rebase --preserve-merges" do (and why?)

这篇关于如何挑选/重组/解决冲突的最终结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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