【问题标题】:Cannot use `git mergetool` with `git am` or `git apply` or `patch`不能将 `git mergetool` 与 `git am` 或 `git apply` 或 `patch` 一起使用
【发布时间】:2019-03-04 11:47:13
【问题描述】:

git mergetool 很棒(在我的例子中,我使用 kdiff3)。但是,无法使用它来解决来自git amgit apply(甚至使用patch 命令)的冲突。事实上,mergetool 需要 3 个文件才能工作(基本版本和两个修改版本),而 git am 需要修改版本和补丁。

您知道使用git mergetool 处理与git am 产生的冲突的方法吗?

我认为有必要从修改版本和补丁中猜测基础文件。如果单独考虑每个块,看起来很棘手,但并非不可能。

【问题讨论】:

  • git mergetool 如果遇到三向合并冲突,应该可以工作。 git am 运行git apply --3way,它使用git diff 输出中的index 行来定位或重建(如果可能)这三个对象。如果您发现补丁不适用并且缺少或错误或不足的index 行,那么您无能为力。好吧,没有什么是三通的:你可以使用git apply --reject,然后在编辑器中手动按摩被拒绝的部分,就像我们过去在糟糕的过去所做的那样。 ..

标签: git-merge patch mergetool git-apply git-am


【解决方案1】:

正如torek 提到的,git mergetool 将参与其中,如果您是:

问题仍然存在于常规补丁命令中。

【讨论】:

    猜你喜欢
    • 2023-03-16
    • 2016-06-23
    • 1970-01-01
    • 2012-08-27
    • 2013-04-24
    • 2014-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多