alonli 发表于 2018-1-16 12:09:06

使用Kdiff3 来解决Git的文件冲突

  Kdiff3 的下载地址为:
  http://kdiff3.sourceforge.net/
  要想在Git GUI 中增加Merge Tool 有2种方式:
一,在”.gitconfig ” 文件中进行修改。
  .gitconfig 文件通常会在
https://images.cnblogs.com/cnblogs_com/jiguixin/201110/201110251113084744.png
  用记事本打开它,把下面的文本加进去就行了。
  tool = kdiff3

  path = c:/Program Files/KDiff3/kdiff3.exe

  tool = kdiff3
  guitool = kdiff3

  path = c:/Program Files/KDiff3/kdiff3.exe
  

  注:1,kdiff3.exe 的路径肯定是你安装Kdiff3的路径。2,不要盲目复制看清楚path与你的文件系统目录是有区别的哈。

二,通过Git Bash来完成。
  因为没有试这种方式就直接上答案:
  I've been looking for the silver bullet solution to using KDiff3 as my git mergetool on Windows (using Git GUI).I've finally got a solution that works in every Windows environment I've tried:


[*]Add the KDiff3 directory to your Windows System Path (e.g. C:\Program Files\KDiff3\)
[*]Add kdiff3 as your Git mergetool (From Git Bash, run git config --global merge.tool kdiff3)
[*]Add kdiff3 complete path to Git Config (From Git Bash, run git config --global meregtool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe")
[*]Go into Git GUI settings and set the mergetool to kdiff3 (if Git GUI doesn't pick up this setting from git config, which it should)
  Regardless of what I tried and/or read online, setting all possible settings is the only way KDiff3 works every time I select "Run Merge Tool" from the Git GUI right-click menu when there is a merge conflict.
  Cheers,

  -Kevin Wentworth
  参考地址:http://www.mainelydesign.com/blog/view/using-kdiff3-as-git-gui-merge-tool-on-windows-xp-windows-7
页: [1]
查看完整版本: 使用Kdiff3 来解决Git的文件冲突