IntelliJ Diff Tool in SourceTree

Is it possible to use IntelliJ Diff tool in SourceTree? I know it is accessible from terminal.

Thanks

  • Source Tree for Windows doesn't seem to work with valid SSH key
  • Force SourceTree ignore line endings in git files
  • SourceTree for Windows not working
  • Git is very slow on Mac / OSX
  • git cherry picking one commit to another branch
  • What is the difference between Stop Tracking and Discard File in git SourceTree
  • Push to gerrit using SourceTree
  • How to change git branch output order
  • NuGet and Git Submodules
  • What does git “added by us” mean?
  • Git problem with interactive rebase
  • How to include part of another git repository using git subtree and merge updates in both directions
  • 7 Solutions collect form web for “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

    enter image description here

    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 OSX android studio i’ve accomplished with this steps:

    Open IntelliJ/Android Studio -> Tools -> Create Command Line Launcher
    Something like this:

    After that, open SourceTree Preferences: and put “/usr/local/bin/studio” in Diff/Merge Command.
    Like this:
     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.

    If somebody is interested in Android Studio settings in Mac:

    <path to IntelliJ IDEA launcher>:
    /Applications/Android\ Studio.app/Contents/MacOS/studio
    
    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>
    

    The only problem which I notice is that Android Studio cannot show more than 1 diff at once. When I try, it complains that the file cannot be showed

    On Mac with intellij 2016

    diff $LOCAL $PWD/$REMOTE
    
    merge $PWD/$LOCAL $PWD/$REMOTE $PWD/$BASE $PWD/$MERGED
    

    For the merge-tool on windows, these arguments work for me:

    merge $PWD/$LOCAL $PWD/$REMOTE $PWD/$MERGED
    

    On macOS with IntelliJ IDEA CE.

    Diff Command: open
    Arguments: -W -b com.jetbrains.intellij.ce --args diff "$LOCAL" "$PWD/$REMOTE"

    enter image description here

    Where:

    • open: System command to open files and directories.
    • -W: Causes open to wait until the applications it opens (or that were already open) have exited.
    • -b com.jetbrains.intellij.ce: Bundle identifier for the application to use when opening the file.
    • --args: All remaining arguments are passed to the opened application in the argv parameter to main().
    Git Baby is a git and github fan, let's start git clone.