在git中使用p4merge合并工具时出错 [英] error with p4merge merging tool in git

查看:376
本文介绍了在git中使用p4merge合并工具时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为p4merge设置了类路径并设置了文件.gitconfig,但是当p4merge工具假设打开这两个冲突的文件时,出现此错误。任何人都知道解决方案?

添加到classpath:C:\ Program Files \Perforce\p4merge.exe
添加到.gitconfig文件中:

  [合并] 
工具= p4merge
[mergetoolp4merge]
cmd = p4merge.exe \\\\$ BASE \\\\\\\\$ LOCAL \\\\\\\$ REMOTE \\\ \\\\$ MERGED \\\

错误信息:

 'protected / views / layouts / main.php'的正常合并冲突:
{local}:修改文件
{remote}:修改文件
打开返回以启动合并解析工具(p4merge):
C:\程序文件(x86)\Git / libexec / git-core / mergetools / p4merge :第8行:p4merge:
命令未找到
protected / views / layouts / main.php似乎没有变化。
合并成功了吗? [y / n] n
protected / views / layouts / main.php合并失败


解决方案

为什么一切都如此困难,我讨厌编写命令,所以我做了什么?


  1. 安装p4Merge工具表格



    < ol start =2>
  2. 安装它为Windows用户


  3. 进入用户目录并搜索 .gitconfig 编辑并添加




  [mergetoolp4merge] 
path = C:\\ Program Files \\Perforce\\p4merge.exe
cmd = \C:/ Program Files / Perforce的/ p4merge。 $ BASE$ LOCAL$ REMOTE$ MERGED
[合并]
工具= p4merge


如何使用它?当你拉一些东西并发生冲突时,你可以写出:

lockquote
git mergetool
$ / $ block

并且该工具将被打开。



底部是您可以编辑的最终版本,然后保存并提交,冲突将得到解决。


I have setup my classpath for p4merge an set the file .gitconfig, but there i get this error when the p4merge tool suppose to opem those two files that are in conflict. anybody knows the solution?

added to classpath: "C:\Program Files\Perforce\p4merge.exe" added to .gitconfig file:

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

ERROR MESSAGE:

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

解决方案

Why is everything so hard I hate to write commands so what I did?

  1. Install p4Merge tool form here serach for P4Merge and install the exe then you need only

  1. Install it as Windows user

  2. Go into your user direcotry and search for .gitconfig edit it and add

[mergetool "p4merge"]
  path = C:\\Program Files\\Perforce\\p4merge.exe
  cmd = \"C:/Program Files/Perforce/p4merge.exe\" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
[merge]
  tool = p4merge

How to use it? When you pull something and have conflicts you can just write

git mergetool

And the tool will be open.

At the bottom is you final version you can edit there then just save and commit and the conflict will be resolved.

这篇关于在git中使用p4merge合并工具时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆