78144666 发表于 2018-1-16 06:06:24

git设置对比工具

  windows下设置 beyond compare 3 为 git的对比工具。
  首先需要先安装 beyond compare 3 工具,切记需要安装安装版的,不要搞绿色版的。
  mac下使用 Kaleidoscope,具体步骤请看 http://www.cnblogs.com/ayseeing/p/4453685.html
  git查看有哪些对比工具可以设置命令:
  

$ git difftool --tool-help  

  

  然后再设置对不工具,如:
  

$ git config --global diff.tool bc3  
$ git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
  

  

  设置默认的合并工具设置和对比工具类似:
  

$ git config --global merge.tool bc3  
$ git config --global mergetool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
  

  

  也可以直接修改.gitconfig文件,直接增加如下:
  

  
tool = bc3
  

  
path = d:/program files/beyond compare 3/bcomp.exe
  

  
tool = bc3
  

  
path = d:/program files/beyond compare 3/bcomp.exe
  

  

  具体地址根据个人电脑配置。
  设置好后,使用命令是 git difftool 而不是之前的 git diff 了。
  git difftool说明文档:http://git-scm.com/docs/git-difftool.html
页: [1]
查看完整版本: git设置对比工具