Search code examples
gitmergetooldifftool

Problems using diffmerge mergetool with git


I was trying to resolve some merging conflicts in git using diffmerge, which I just set op on my machine, but it fails and thie error appears:

Hit return to start merge resolution tool (diffmerge):
C:\Program Files (x86)\Git/libexec/git-core/mergetools/diffmerge: line 136: diffmerge: command not found
merge of nextclue_input.cpp failed

Here are the contents of the file the path is pointing at:

diff_cmd () {
    "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1
}

merge_cmd () {
    if $base_present
    then
        "$merge_tool_path" --merge --result="$MERGED" \
            "$LOCAL" "$BASE" "$REMOTE"
    else
        "$merge_tool_path" --merge \
            --result="$MERGED" "$LOCAL" "$REMOTE"
    fi
    status=$?
}

And here is how I setup my .gitconfig file for diffmerge:

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    cmd = diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
    trustExitCode = true
[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = diffmerge $LOCAL $REMOTE

I don't understand please help.


Solution

  • Likely diffmerge isn't in %PATH%. Try to specify a full path to the command in mergetool.diffmerge.cmd and difftool.diffmerge.cmd (cmd settings 2nd and 4th sections)