【问题标题】:Why the mergetool isn't opened when I use --3way on git apply?为什么我在 git apply 上使用 --3way 时没有打开合并工具?
【发布时间】:2013-04-11 15:30:36
【问题描述】:

为什么我无法使用带有 -3 选项的 git apply :

$ git apply --3way /tmp/0001-my-patch.patch
error: patch failed: a.h:9
Falling back to three-way merge...
Applied patch to 'a.h' cleanly.
error: patch failed: b.c:6
Falling back to three-way merge...
Applied patch to 'b.c' cleanly.
error: patch failed: drivers/Kconfig:1882
Falling back to three-way merge...
Applied patch to 'drivers/Kconfig' with conflicts.
U drivers/Kconfig

【问题讨论】:

标签: git git-merge-conflict mergetool git-apply


【解决方案1】:

这是一种将diffmerge 配置为合并工具的方法[取自here]

git config --global merge.tool diffmerge

git config --global mergetool.diffmerge.cmd "diffmerge --merge
--result=\$MERGED \$LOCAL \$BASE \$REMOTE"

git config --global mergetool.diffmerge.trustExitCode true

【讨论】:

    【解决方案2】:

    来自git apply 的文档:

    --3way
    当补丁不能干净地应用时,回退到 3-way 合并

    如果补丁应用干净,看起来 3way 将被忽略。

    【讨论】:

      猜你喜欢
      • 2017-04-28
      • 2011-10-31
      • 1970-01-01
      • 2018-05-05
      • 2022-12-18
      • 1970-01-01
      • 2013-01-27
      • 2020-02-02
      • 1970-01-01
      相关资源
      最近更新 更多