博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Git-配置difftool和mergetool

Posted on 2018-04-19 19:05  (︶O︶)  阅读(681)  评论(0编辑  收藏  举报

git自带的difftool和mergetool使用不习惯,配置difftool和mergetool为Beyond Compare 3。

git的配置文件一般在C:\Users\用户名\.gitconfig。我使用的MinGW Shell,git的配置文件在C:\MinGW\msys\1.0\home\用户名\.gitconfig

 1 [diff]
 2     tool = bc3
 3 [difftool]
 4     prompt = false
 5 [difftool "bc3"]
 6     cmd = \"D:\\Program Files (x86)\\Beyond Compare 3\\BCompare.exe\" \"$LOCAL\" \"$REMOTE\"
 7 [merge]
 8     tool = bc3
 9 [mergetool]
10     prompt = false
11     keepBackup = false
12 [mergetool "bc3"]
13     cmd = "\"D:\\Program Files (x86)\\Beyond Compare 3\\BCompare.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
14     trustexitcode = true

使用git config --global alias.别名 ‘真名’

1 git config --global alias.dt 'difftool'
2 git config --global alias.mt 'mergetool'

链接:https://pan.baidu.com/s/1EVXtYJVjqknXPnWYGk7vIg 密码:xnjz