PhpStorm as diff tool in Sourcetree

I’am using JetBrain toolbox and this is the config I made for Sourcetree to do diff operations on PhpStorm:

First open PhpStorm and create a command line launcher: Tools -> Create command line launcher..

In my case It suggested: /usr/local/bin/pstorm

Next open Sourcetree preferences and in the Diff tab set those values for diff:

  • Visual Diff Tool: Custom..
  • Diff Command: /usr/local/bin/pstorm
  • Arguments: diff $LOCAL $PWD/$REMOTE

Set those values for Merge:

  • Merge Tool: Custom..
  • Merge Command: /usr/local/bin/pstorm
  • Arguments: merge $PWD/$LOCAL $PWD/$REMOTE $PWD/$BASE $PWD/$MERGED