1. 程式人生 > >centos 使用 beyond compare 對比工具

centos 使用 beyond compare 對比工具

config log x86 diff shel git -- img .cn

我這裏的環境是centos7桌面版

三條命令安裝beyond compare

wget http://www.scootersoftware.com/bcompare-4.2.3.22587.x86_64.rpm

rpm --import http://www.scootersoftware.com/RPM-GPG-KEY-scootersoftware

yum install bcompare-4.2.3.22587.x86_64.rpm

安裝好之後就可以直接用bcompare命令調出對比工具了

然而我要做的是把git的差異對比換成bcompare 否則要它何用

默認的git對比是這樣的

技術分享圖片

看著都想吐

第一步 找一個目錄 創建一個shell腳本 我這裏選擇把腳本放在家目錄去

vim /root/git-diff.sh

加入如下兩行

#!/bin/sh

"bcompare" "$2" "$5" | cat

再給個權限

chmod 755 /root/git-diff.sh

第二步 修改git項目中的config文件

vim ./.git/config

添加如下兩行

[diff]
external = /root/git-diff.sh

保存退出:wq

再調 git diff 1.txt

看到的是這樣的

技術分享圖片

centos 使用 beyond compare 對比工具