Mac 使用Beyond Compare执行svn diff和svn merge

Posted by fengmiaosen on 2016-06-06

安装 Beyond Compare

下载安装地址

安装 Command Line Tools

打开 Beyond Compare,菜单栏中点击安装命令行工具 Command Line Tools

beyond

设置svn

svn diff

  • 创建 /usr/local/bin/bcdiff.sh 脚本
  • 执行如下命令添加脚本执行权限

    1
    chmod +x /usr/local/bin/bcdiff.sh
  • 在上述 bcdiff.sh 脚本中添加如下执行命令:

    1
    2
    3
    #!/bin/bash
    /usr/local/bin/bcompare "$6" "$7" -title1="$3" -title2="$5" -readonly
    exit 0
  • 打开并编辑 **$HOME/.subversion/config 配置文件,在 [Helpers] 部分添加如下命令行:

    1
    diff-cmd = /usr/local/bin/bcdiff.sh

svn merge

  • 创建 /usr/local/bin/bcmerge.sh 脚本
  • 执行如下命令添加脚本执行权限

    1
    chmod +x /usr/local/bin/bcmerge.sh
  • 在上述 bcmerge.sh 脚本中添加如下执行命令:

    1
    2
    #!/bin/bash
    /usr/local/bin/bcompare "$2" "$3" "$1" "$4"
  • 打开并编辑 $HOME/.subversion/config 配置文件,在 [Helpers] 部分添加如下命令行:

    1
    merge-tool-cmd = /usr/local/bin/bcmerge.sh

参考资料