Skip to content

Instantly share code, notes, and snippets.

@jmlane
Forked from jvandyke/.gitconfig
Last active January 27, 2023 08:11
Show Gist options
  • Save jmlane/6877474 to your computer and use it in GitHub Desktop.
Save jmlane/6877474 to your computer and use it in GitHub Desktop.
Git config for PHP/WebStorm as diff and merge tool on Windows. See http://www.jetbrains.com/webstorm/webhelp/running-webstorm-as-a-diff-or-merge-command-line-tool.html for information on using the diff/merge functionality in the IDE on the command line.
# ~/.gitconfig
# Add this to your global git configuration file
# Change webstorm to phpstorm, 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 "phpstorm"]
path = \""C:/Program Files (x86)/JetBrains/WebStorm/bin/"\"
cmd = WebStorm.exe diff \"$LOCAL\" \"$REMOTE\"
trustExitCode = true
[mergetool "phpstorm"]
path = \""C:/Program Files (x86)/JetBrains/WebStorm/bin/"\"
cmd = WebStorm.exe merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
trustExitCode = true
@jmlane
Copy link
Author

jmlane commented Oct 8, 2013

If you are using TortoiseGit, you must explicitly set the external diff and merge tool commands in the application settings:

  • For Diff: C:\Program Files (x86)\JetBrains\WebStorm\bin\WebStorm.exe diff %mine %theirs
  • For Merge: C:\Program Files (x86)\JetBrains\WebStorm\bin\WebStorm.exe merge %mine %theirs %base %merged

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