I have conflicts, so I type:
git mergetool
I then get a message saying:
Hit return to start merge resolution tool
>
Git has --auto
hard coded as a command-line option to KDiff3, which causes the GUI not to show up if all conflicts are auto-resolvable by KDiff3.
We can change this default behavior by setting:
git config --global mergetool.kdiff3NoAuto.cmd "/c/Program Files/KDiff3/kdiff3.exe --L1 \"\$MERGED (Base)\" --L2 \"\$MERGED (Local)\" --L3 \"\$MERGED (Remote)\" -o \"\$MERGED\" \"\$BASE\" \"\$LOCAL\" \"\$REMOTE\""
which result in the ~/.gitconfig
file (or you can directly modify the file):
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
cmd = \"/c/Program Files/KDiff3/kdiff3.exe\" --L1 \"$MERGED (Base)\" --L2 \"$MERGED (Local)\" --L3 \"$MERGED (Remote)\" -o \"$MERGED\" \"$BASE\" \"$LOCAL\" \"$REMOTE\"
[diff]
guitool = kdiff3
[difftool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
In this way, the kdiff3 will alway open whether there is still unsolved conflicts left.
Ref: https://stackoverflow.com/a/15813064/2303761