Why does my Git mergetool configuration not work?

不羁岁月 提交于 2020-01-04 06:58:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!