PhpStorm 2018.2 Help

Viewing Difference Between Files from Command Line

You can use PhpStorm as a command line tool for viewing differences between files.

  • In the command line, run the diff command using the following syntax:

    <PhpStorm> diff path1 path2

The selected files will be opened in the Differences Viewer for Files.

The command options are as follows:




The platform-specific PhpStorm launcher.

On macOS and Linux, it is recommended to use the command-line launcher created during the PhpStorm installation, or create one manually by selecting Tools | Create Command-line Launcher on the PhpStorm main menu. Refer to Besides working from within PhpStorm, you can perform the following actions from the command line: for details.

On Windows, it is recommended to add the path to the PhpStorm executable to the Path environment variable.


The full path to the local copy of the file.


The full path to the repository version copy of the file.


phpstorm.exe diff path1 path2
phpstorm.exe diff C:\MyProject\ C:\MyProject\
phpstorm diff path1 path2
phpstorm diff ~/MyProject/ ~/MyProject/
Last modified: 21 November 2018

See Also