美文网首页
diff 工具环境搭建

diff 工具环境搭建

作者: cdz620 | 来源:发表于2020-03-02 14:22 被阅读0次

    环境搭建

    1. 安装BeyondCompare

    2. 将bcmp 软连接到/usr/local/bin,命令行可以调用: ln -s /Applications/Beyond\ Compare.app/Contents/MacOS/bcomp /usr/local/bin

    3. 打开source tree --》 preference --》 diff tab --》 设置如下

    • 参数1: $LOCAL $REMOTE

    • 参数2: $LOCAL $REMOTE $BASE $MERGED

    1. 使用 source右击文件

    命令行 + BeyndCompare

    difftool设置

    • git config --global diff.tool bcomp

    • git config --global difftool.bcomp.cmd '/usr/local/bin/bcomp LOCALREMOTE'

    • 使用:

    • git difftool master origin/test file 比较本地的master分支和远程的test分支,file文件的差别

    • git difftool branch1 branch2 两分支比较

    • git difftool file 和代码库中的文件比较

    • git difftool some-branch script.js 和某个分支的script.js比较

    mergetool设置

    • git config --global merge.tool bcomp

    • git config --global mergetool.bcomp.cmd '/usr/local/bin/bcomp LOCALREMOTE BASEMERGED'

    • git config --global mergetool.bcomp.trustExitCode true

    • git config --global mergetool.keepBackup false 设置解决完冲突后不产生orig文件

    • 使用: 有冲突是执行 git mergetool


    相关配置

    • git config --global merge.conflictstyle diff3 设置冲突时显示的样式,

    相关文章

      网友评论

          本文标题:diff 工具环境搭建

          本文链接:https://www.haomeiwen.com/subject/ufqkchtx.html