Skip to content

Instantly share code, notes, and snippets.

@scoutman57
Created April 24, 2014 20:28
Show Gist options
  • Save scoutman57/11268447 to your computer and use it in GitHub Desktop.
Save scoutman57/11268447 to your computer and use it in GitHub Desktop.
Use PHPStorm as your git diff tool
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm
[difftool]
prompt = false
[difftool "phpstorm"]
cmd = /Applications/PhpStorm\\ EAP.app/Contents/MacOS/phpstorm diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
trustExitCode = true
[mergetool "phpstorm"]
cmd = /Applications/PhpStorm\\ EAP.app/Contents/MacOS/phpstorm merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
@scoutman57
Copy link
Author

Add this to your global .gitconfig file.

@JohnAlbin
Copy link

See https://gist.github.com/jvandyke/4355099#comment-1437345 for a simpler version you can use on new versions of PHPStorm and WebStorm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment