博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
beyond compare 与git diff整合
阅读量:7061 次
发布时间:2019-06-28

本文共 950 字,大约阅读时间需要 3 分钟。

这两天花了点时间最终在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的很多其它内容请參考《 》

转载于:https://www.cnblogs.com/yutingliuyl/p/6727084.html

你可能感兴趣的文章
css文本内容大于内本显示框设置其显示方式
查看>>
java类加载机制
查看>>
Semaphore(信号量)源码分析
查看>>
word2tex之类的问题
查看>>
级连查询与更新
查看>>
Maven报错:ArtifactdescriptorException: failed to read artifact for xxxxxx
查看>>
C# API 调用格式和参数类型
查看>>
无法删除MySql数据库,报错1010 error dropping
查看>>
Android application使用总结
查看>>
硬币问题
查看>>
鼠标悬停图片移动的效果
查看>>
YII2操作mongodb笔记(转)
查看>>
javaScript 比较数字大小
查看>>
从汇编来看c语言之指针
查看>>
sqlserver查询表索引
查看>>
JavaScript 基础知识系列:数据类型及slice(8,-1)
查看>>
String,StringBuffer,StringBuilder三者有什么异同?
查看>>
[LeetCode] Invert Binary Tree
查看>>
uincode常识
查看>>
QT两个字符串转化函数,避免文字乱码。
查看>>