IntelliJ Diff Tool in SourceTree
Took some time to figure out arguments.
Diff command text box should contain path to intellij, like: /Applications/IntelliJ\ IDEA\ 12.app/Contents/MacOS/idea
Windows
Diff Command: C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.2\bin\idea.exe
Arguments: diff $LOCAL $PWD/$REMOTE
Merge Command: C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.2\bin\idea.exe
Arguments: (This isn't working right for me. I'm having pathing problems.) merge $LOCAL $PWD/$REMOTE $PWD/$BASE $MERGED
As of 12.1, these are the arguments for using IntelliJ's diff and merge tools from outside the program:
Diff tool<path to IntelliJ IDEA launcher> diff <path to file1> <path to file2>
Merge tool<path to IntelliJ IDEA launcher> merge <path to file1> <path to file2> <path to file3> <path to output>
OFFICIAL DOCUMENTATION: running-intellij-idea-as-a-diff-or-merge-command-line-tool
FWIW, I ended up using IntelliJ for my source control. I like it more than Sourcetree. It's quite robust.
For today (January 2019) it works at windows like this:
External Diff/Merge:
Diff tool:
Diff Command: C:\Program Files\JetBrains\WebStorm 2018.3.1\bin\webstorm64.exe
Agruments: diff $LOCAL $REMOTE
Merge Tool:
Diff Command: C:\Program Files\JetBrains\WebStorm 2018.3.1\bin\webstorm64.exe
Agruments: merge $LOCAL $REMOTE $BASE $MERGED
For OSX android studio i've accomplished with this steps:
Open IntelliJ/Android Studio -> Tools -> Create Command Line Launcher
After that, open SourceTree Preferences: and put "/usr/local/bin/studio" in Diff/Merge Command. Like this:
Diff Arguments:
diff $LOCAL $PWD/$REMOTE
Merge Arguments:
merge $PWD/$LOCAL $PWD/$REMOTE $PWD/$BASE $PWD/$MERGED
And if everything it's ok it should work.