Git Windows下配置Merge/Diff工具DiffMerge
參考:Git Windows下配置Merge工具DiffMerge
-
下載DiffMerge
DiffMerge下載地址
Paste_Image.png 創(chuàng)建啟動DiffMerge腳本
1)在Git的安裝路徑的\cmd路徑下創(chuàng)建以下兩個腳本,注意安裝路徑,見圖
git-difftool-diffmerge-wrapper.sh
# place this file in the Windows Git installation directory /cmd folder
# be sure to add the ../cmd folder to the Path environment variable
# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode
"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" "$1" "$2" | cat
git-mergetool-diffmerge-wrapper.sh
# place this file in the Windows Git installation directory /cmd folder
# be sure to add the ../cmd folder to the Path environment variable
# passing the following parameters to mergetool:
# local base remote merge_result
"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" "$1" "$2" "$3" --result="$4" --title1="Mine" --title2="Merge" --title3="Theirs"

Paste_Image.png

Paste_Image.png
2)將\cmd設置環(huán)境變量,方便找

Paste_Image.png
3)黑掉Git配置文件
找到.gitconfig文件(路徑在Windows“用戶”路徑下),
相關內(nèi)容用下面的替換
[merge]
tool = diffmerge
[diff]
tool = diffmerge
[mergetool]
keepBackup = false
[mergetool "diffmerge"]
cmd = git-mergetool-diffmerge-wrapper.sh "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
[difftool "diffmerge"]
cmd = git-difftool-diffmerge-wrapper.sh "$LOCAL" "$REMOTE"
4)解決中文亂碼問題

Paste_Image.png

Paste_Image.png
