由于在powershell中,git diff
命令通常会产生大量无法阅读的空格或奇怪字符,因此我安装了Perforce P4Merge来处理合并和差异。
然而,我无法让 git diff
命令打开p4merge应用程序以查看差异。到目前为止,我的.gitconfig文件如下:
[diff]
tool = p4diff
[difftool "p4diff"]
external = 'C:/PROGRA~1/Perforce/p4merge.exe "$LOCAL" "$REMOTE"'
prompt = false
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
path = 'C:/PROGRA~1/Perforce/p4merge.exe'
prompt = false
keepBackup = false
keepTemporaries = false
trustExitCode = false
路径是正确的。但是遗憾的是,在使用“git diff”命令时,git仍然试图在PowerShell中显示差异。
那么,如何使其正常工作呢?