-
-
Save jvandyke/4355099 to your computer and use it in GitHub Desktop.
# ~/.gitconfig | |
# Add this to your global git configuration file | |
# Change phpstorm to webstorm, if you use that. | |
# Diff and merge tool changes | |
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...` | |
[merge] | |
tool = phpstorm | |
[diff] | |
tool = phpstorm | |
[difftool] | |
; This setting is optional, but prevents an annoying prompt between diffing files. | |
prompt = false | |
[difftool "phpstorm"] | |
; Putting this path here doesn't work. I would love to know why. | |
; path = /Applications/PHPStorm.app/Contents/MacOS | |
cmd = webide diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") | |
trustExitCode = true | |
[mergetool "phpstorm"] | |
cmd = webide 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 |
# Add this to your .profile, .zshrc, .bashrc, etc. | |
# Add PHPStorm's bin directory to your path. | |
export PATH="/Applications/PHPStorm.app/Contents/MacOS:$PATH" |
Stopped working for me all the sudden. Now "git mergetool /somefile/..." gives me "No IDE instance has been found. New one will be started."
Like @raffaelo I used to have a mergetool gui pop up so I could visually merge what I wanted was best tool around.
JetBrains support supplied this to fix it: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program
Verified working: PhpStorm-EAP-162.1447.5.dmg
None of the solution worked for me Webstorm 2016.2, unless I set
prompt = true
Then even the handy solution of JohnAlbin works.
If prompt = false
, only the first file in the list is opened correctly, then all the other files are not found, prompting:
Error showing diff: Can't find file /tmp/Us1QSf_myfile.js
@thoma5B You just saved me some headaches with that prompt, thanks mate.
If you can not find wstorm
, open WebStorm, and go to Tools
in menu bar then click Command-line Laucher
. My WebStorm version is 2016.2.3
.
BTW, I can directly use the solution of @JohnAlbin. Thanks.
- You can also configure it with commands like
git config --global mergetool.pstorm.trustExitCode true
. - You can use
difftool --dir-diff
, but currently tmp-files may be instantly removed, so I appended mydifftool.pstorm.cmd
with; read
and pressEnter
after diff completion.
FYI: @zored I had to use && read
instead on my system, in order for it to not delete the files before I'm done with them.
But that way, it works (for me too). Great work around, though! ๐ ๐
P.S.: adding an additional --symlinks
flag to the difftool --dir-diff
is also a nice "upgrade"...
great!
but it doesn't show me any output to me, neither error.
does it conflict with other open PHPStorm istances?
Well, i was expected that a window will pop up to resolve the conflicts, independtly. But nothing shows up and git ask me if the conflict was resolved.