[Git] 設定 git difftool 使用 Beyond Compare 比較檔案

[Git] 設定 git difftool 使用 Beyond Compare 比較檔案

之前曾經 設定 git diff 使用外部檔案比較工具

只要用 git diff 就會自動啟動 Beyond Compare 來比較檔案~

 

不過對於只是很小的修改而言,

原本 git diff 顯示的方式是比較快速的,

因此又想將 git diff 改回原本的樣子,

改用 git difftool 呼叫 Beyond Compare~

 

直接修改 Mac 上的 ~/.gitconfig,加入下面的內容:

[difftool "bcompare"]
    cmd = /usr/local/bin/bcomp \"$LOCAL\" \"$REMOTE\"
    path =

[diff]
	tool = bcompare

 

這樣子 git difftool 就知道要使用 Beyond Compare 來比較檔案了,

同時還可以加上 -y 選項,讓 git 不要每個檔案都詢問是否要比較,例如:

git difftool -y HEAD~1

 

參考資料:

Git – git-difftool Documentation

Git 教程 – 比較版本差異

(本頁面已被瀏覽過 2,300 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料