当我在git apply上使用--3way时,为什么不打开mergetool?

时间:2013-04-18 13:27:14

标签: git

为什么我没有使用带有-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

2 个答案:

答案 0 :(得分:0)

来自git apply的文档:

  

- 3WAY
  当补丁不能完全应用时,请回到3向合并

如果补丁干净利落,看起来将会忽略3way。

答案 1 :(得分:0)

以下是一种将diffmerge配置为mergetool的方法[取自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