我已经为p4merge设置了我的类路径,并设置了一个.gitconfig文件,但是当p4merge工具假设要对付这两个冲突的文件时,我会收到此错误消息。有人知道解决方案吗?

添加到类路径:“C:\Program Files\Perforce\p4merge.exe”
添加到.gitconfig文件:

[merge]
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge.exe \\\"$BASE\\\" \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$MERGED\\\"

错误信息:
Normal merge conflict for 'protected/views/layouts/main.php':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (p4merge):
C:\Program Files (x86)\Git/libexec/git-core/mergetools/p4merge: line 8: p4merge:
 command not found
protected/views/layouts/main.php seems unchanged.
Was the merge successful? [y/n] n
merge of protected/views/layouts/main.php failed

最佳答案

这个对我有用:

[merge]
    keepBackup = false;
    tool = p4merge
[mergetool "p4merge"]
    path = C:/Program Files/Perforce/p4merge.exe
    cmd = \"C:/Program Files/Perforce/p4merge.exe\" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
    keepTemporaries = false
    trustExitCode = false
    keepBackup = false
[difftool]
    prompt = false
[mergetool]
    prompt = false

关于git - git中的p4merge merge 工具错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10742129/

10-12 16:47