0x90
0x90

Reputation: 41022

Why the mergetool isn't opened when I use --3way on git apply?

Why I fail to use git apply with -3 option :

$ 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

Upvotes: 2

Views: 320

Answers (2)

0x90
0x90

Reputation: 41022

Here is a way to configure diffmerge as your mergetool [taken from 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

Upvotes: 0

Guvante
Guvante

Reputation: 19221

From the documentation for git apply:

--3way
When the patch does not apply cleanly, fall back on 3-way merge

It looks like 3way will be ignored if the patch applies cleanly.

Upvotes: 0

Related Questions