Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
938 views
in Technique[技术] by (71.8m points)

windows - How to set Araxis as diff / merge tool for MSYS git?

I'm trying to use Araxis Merge as my diff / merge tool for MSYSGit.

I found a few resources on the net:

  • On the Araxis site, they mention an "easy" way, but it implies a executables (araxisgitdiff.exe and araxisgitmerge.exe) that are not part of my distro.
  • I also found some info in gitguru, but the actual information re: Araxis is sparse at best, and I could not make anything out of that.
  • Finally, there was some info on an older stackoverflow post, but the suggested method doesn't work for me. That particular info was geared towards OS X. I "translated" to Windows as best as I could, but without success:

I created /bin/git-diff-driver.sh

#!/bin/sh

"/c/Program Files/Araxis/Araxis Merge/compare.exe" -title1:"$1 (repo version)" -title2:"$1 " -max "$2" "$5"

and edited gitconfig

[merge]
    tool = araxismerge
[mergetool "araxismerge"]
    cmd = "/c/Program Files/Araxis/Araxis Merge/compare.exe" -3 -merge -wait $LOCAL $BASE $REMOTE $MERGED
[diff]
    external = "/bin/git-diff-driver.sh"

and the only result I get is:

$ git diff HEAD^ HEAD
external diff died, stopping at PowerEditor/src/Notepad_plus.cpp.


Edit:

I've also tried with the exe named as "c:/Program Files/Araxis/Araxis Merge/compare.exe" as suggested by one of the answers, with the same results.


Edit:

I've found that it can easily be set if you use TortoiseGit, but it seems to handle diff by itself and no settings from TortoiseGit give any indication on how to set up Araxis as a merge tool when diff is invoked from the command line.


Edit:

So, the question is: Is there anybody who successfully uses Araxis Merge to diff and merge stuff with MSYSGit, and if so, how do you it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you want to have 'git diff' always use araxis you can use the instructions in the help file, but if you want to have control to use 'git diff' as you normally would from the command line and 'git difftool' to engage the Araxis GUI.

Try adding the following to your git config::

[difftool "araxis"]
    path = "/c/Program Files/Araxis/Araxis Merge/compare.exe"
    renames = true
    trustExitCode = true
[diff]
    tool = araxis
    stat = true
[mergetool "araxismergetool"]
    cmd = 'C:\Program Files\Araxis\Araxis Merge\araxisgitmerge.exe' "$REMOTE" "$BASE" "$PWD/$LOCAL" "$PWD/$MERGED"
    trustExitCode = false
[mergetool]
    keepBackup = false
[merge]
    tool = araxismergetool
    stat = true

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...