下载

step1:首先,把要运行的命令放入外部包装脚本中,创建一个merge包装脚本,名字叫做extMerge,让它带参数调用P4Merge。

$ cat >> /usr/local/bin/extMerge
#!/bin/sh
/Applications/p4merge.app/Contents/MacOS/p4merge $*

step2:再来创建一个名字为extDiff的脚本。

$ cat >> /usr/local/bin/extDiff 
#!/bin/sh
[ $# -eq 7 ] && /usr/local/bin/extMerge "$2" "$5"

step3:更改权限,使这两个脚本可执行

$ sudo chmod +x /usr/local/bin/extMerge 
$ sudo chmod +x /usr/local/bin/extDiff

step4:接下来在git里配置自定义的diff和merge工具。退出root用户,在本地用户下,执行下面命令 。

$ git config --global merge.tool extMerge
$ git config --global mergetool.extMerge.cmd \'extMerge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"'
$ git config --global mergetool.trustExitCode false
$ git config --global diff.external extDiff

  

相关文章:

  • 2022-01-05
  • 2022-12-23
  • 2021-05-07
  • 2021-10-03
  • 2021-10-04
  • 2022-12-23
  • 2021-08-08
猜你喜欢
  • 2022-02-16
  • 2021-09-18
  • 2021-06-22
  • 2021-12-27
  • 2022-02-27
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案