Doing a three-way compare with Git and KDiff3

前端 未结 2 951
误落风尘
误落风尘 2021-01-11 09:19

Is it possible to set Git up so that I can use the three-way compare in KDiff3?

I have two branches that are far too different to auto-merge them, I simply have to c

相关标签:
2条回答
  • 2021-01-11 10:02

    It seems that git diff do only a 2-way diff (which make sense to generate patch etc) except in a merging state , you have to do a merge for that. I was in a similar situation the other day and I ended up mergin using the ours strategy. That worked but wasn't ideal. Maybe we need a 'nonresolve' merging strategy which doesn't try to resolve any conflicts. You might be able to emulate that by tweaking the .git/MERGE_* files and set all the files as conflicted.
    Otherwise the obvious solution is to checkout 3 different directory and run kdiff3 , but I guess you are looking for a more elegant solution

    0 讨论(0)
  • 2021-01-11 10:13

    Run this on the command line:

    git config --global mergetool.kdiff3.path /path/for/your/kdiff3/binary  
    

    Then, when solving conflicts you just have to do:

    git mergetool --tool=kdiff3
    
    0 讨论(0)
提交回复
热议问题