beyond compare 与git diff整合

               
这两天花了点时间终于在Window和Mac上把Beyong Compare和git整合好,其中遇到到很多坑,现在把这些都分享出来,希望对大家有帮助。
首先假设你已经装好了Beyong Compare。
然后在~/bin/目录下新建一个git-diff-wrapper.sh
window系统的git bash的git-diff-wrapper.sh
 
    
#!/bin/sh
# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode
"D:/tools/Beyond Compare 2/BC2.exe" "$2" "$5" | cat

mac系统的git-diff-wrapper.sh  
 
   

#/bin/sh
# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode
bcompare "$2" "$5"|cat

注意: 你在mac系统中装了beyong compare后需要在菜单栏点击“ Install Command Line Tools ”把它加入到命令行。
Beyond Compare Pro for Mac 4.0.2  破解版下载

在用户目录~下修改.gitconfig文件

 
   

[ user ]
  name = hudashi
  email = hudashi@gmail . com
[ diff ]
external = ~ /bin/ git - diff - wrapper . sh

最后就git diff就ok了。
注意我们在Mac上运行git diff时, 由于系统要保存历史文件到临时目录再进行比较, 而在保存到临时目录又需要很高的权限。 所以我在git  diff前加了 sudo 才能执行成功。即 sudo git diff .
关于git diff的更多内容请参考《 git diff简介
           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自blog.csdn.net/fjjjyf/article/details/87606063