How can I compare a document in the current project with one that is not part of the project? How can I compare two arbitrary files on my computer with phpStorm?
Currently, the easiest way that I found to compare a project file with a non-project file is by copying the external file to the clipboard and clicking on "View-> Compare with clipboard".
Create a file in /usr/local/bin/
named PhpStorm
Paste this
#!/bin/sh
open -na "PhpStorm.app" --args "$@"
And make it executable
chmod +x /usr/local/bin/PhpStorm
And now you can do this
PhpStorm diff <path1> <path2>
Add PhpStorm bin to your PATH
setx PATH=%PATH%;C:\Program Files\JetBrains\PhpStorm\bin
Now you can do this
phpstorm.bat diff <path1> <path2>
Create a link to your PhpStorm launcher script :
# Path to PhpStorm installation may differ
ln -s /opt/phpstorm/bin/phpstorm.sh /usr/local/bin/phpstorm
Now you can do
phpstorm diff <path1> <path2>
Sources from jetbrains werbsite :
https://www.jetbrains.com/help/phpstorm/command-line-differences-viewer.html
https://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With