问题
I want to set trustExitCode
to false and keepTemporaries
to true but it does not work... I don't underestand why. Here is my ~/.gitconfig
:
[merge]
conflictstyle = diff3
tool = p4merge
[mergetool]
keepTemporaries = true
keepBackup = true
trustExitCode = false
[mergetool "p4merge"]
trustExitCode = false
keepTemporaries = true
[mergetool "mymeld"]
cmd = meld --diff $BASE $LOCAL --diff $BASE $REMOTE --diff $LOCAL $MERGED $REMOTE
trustExitCode = false
keepTemporaries = true
[mergetool "myp4merge"]
cmd = p4merge $BASE $LOCAL $REMOTE $MERGED
trustExitCode = false
keepTemporaries = true
When I save some modification, either with p4merge, myp4merge or mymeld, Git doesn't ask me the expected "Was the merge successful? [y/n]" and does not leave file.BASE, file.REMOTE, ...
I can't find the error...
回答1:
I think you should add path
setting to mergetool XYZ
config instead of cmd
. Here is my own setting that works properly.
[mergetool "kdiff3"]
path = PATH_TO_KDIFF3
trustExitCode = false
keepTemporaries = true
[mergetool]
keepBackup = true
[merge]
tool = kdiff3
conflictstyle = diff3
来源:https://stackoverflow.com/questions/22245927/why-does-my-git-mergetool-configuration-not-work