在 git 中使用 diffmerge mergetool 时出现问题

Problems using diffmerge mergetool with git

我试图使用 diffmerge 解决 git 中的一些合并冲突,我刚刚在我的机器上设置了 op,但它失败了并且出现了错误:

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

路径指向的文件内容如下:

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=$?
}

下面是我如何为 diffmerge 设置 .gitconfig 文件:

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

不明白请大家帮忙

可能 diffmerge 不在 %PATH% 中。尝试在 mergetool.diffmerge.cmddifftool.diffmerge.cmd 中指定命令的完整路径(cmd 设置第 2 和第 4 部分)