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

标签 git mergetool difftool

我试图使用 diffmerge 解决 git 中的一些 merge 冲突,我刚刚在我的机器上设置了 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 设置第二部分和第四部分)

关于git - 在 git 中使用 diffmerge mergetool 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27993922/

相关文章:

windows - Windows 上的 Git mergetool 一直从 Git 安装而不是存储库根目录中获得文件路径

gitcherry-pick : how consider only lines modified by the commit (i. e.,不是周围的上下文)?

git difftool --dir-diff : how to copy back changed files

git difftool : how to measure progress, 那是差异化和差异化的文件数量?

git - ASP.NET 5 Beta 7 - GIT 部署中缺少 Microsoft.Dnx.Host.Clr

git - git 应该删除空目录吗?

git - 无法从Dockerfile中的克隆存储库中复制文件

git - 我可以为多个不同的本地位置拥有一个存储库吗

git vimdiff mergetool 基本命令?

Git 和 DiffTool 问题 : What do LOCAL and REMOTE point to?