【问题标题】:Setting diffmerge as visual Git difftool not working将 diffmerge 设置为可视 Git difftool 不起作用
【发布时间】:2012-08-29 10:27:22
【问题描述】:

我正在尝试将 DiffMerge 配置为我在 Git 中的 difftool,但没有运气。这是我的 .gitconfig 文件的重要部分(未显示的其他设置仅供用户使用)。

[diff]
        tool = diffmerge
[difftool "diffmerge"]
        cmd = \"C:\\Program Files\\SourceGear\\Common\\DiffMerge\\sgdm.exe\" \"$LOCAL\" \"$REMOTE\"

每当我从 powershell 命令行调用 git difftool 时,冲突都会直接显示在 powershell 界面的下方,而不是按预期显示在 diffmerge 中。我知道 git 正在获取这些设置,因为当我检查全局配置时,我会从配置文件中获得设置:

git config --global --get-all difftool.diffmerge.cmd
"C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe" "$LOCAL" "$REMOTE"

我正在运行 powershell 而不是 git bash。这是因为我为 windows 安装了 github,它提供了 powershell 作为 git 的 shell,所以我还不需要安装 bash。 Git 版本是 1.7.11.msysgit.0。

【问题讨论】:

    标签: git powershell git-config github-for-windows diffmerge


    【解决方案1】:

    我被difftoolmergetool 搞混了。我需要使用mergetool 来解决与视觉界面的冲突并保存结果。 difftool 仅向您显示差异。详情请参阅git-mergetool-vs-difftool

    我将此部分添加到我的 .gitconfig 并改为从 powershell 命令行调用 git mergetool。快乐的日子。

    [merge]
        tool = diffmerge
    [mergetool "diffmerge"]
        cmd = \"C:\\Program Files\\SourceGear\\Common\\DiffMerge\\sgdm.exe\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
        trustExitCode = true
        keepBackup = false
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多