PhpStorm 7.1.0 Web Help

PhpStorm provides a dedicated Differences Viewer for Folders for comparing files in two folders against the file size, content, or timestamp. The Differences Viewer shows the contents of the selected directories in the left and right panes of the Item List. The contents of the selected file are shown in the lower pane, with the differences being color-highlighted.

Besides exploring differences, the tool also provides interface for synchronizing the contents of folders.

In this section:

To open the difference viewer, do one of the following:
  • Keeping the Ctrl key pressed, click two directories in the Project tool window, and choose Compare Directories on the context menu of the selection, or press Ctrl+DCtrl+DCtrl+DCtrl+DCtrl+DCtrl+DCtrl+DCtrl+DCommand DCommand DCommand D.
  • Select a directory in the Project tool window, choose Compare with on the context menu of the selection, and then select the second directory in the dialog that opens.

    Tip

    You can also open the difference viewer without running PhpStorm. This is done through the following command: <path to PhpStorm executable file> diff <path_1> <path_2> where path_1 and path_2 are paths to the folders in question.

To compare two folders in the difference viewer, perform these general steps:
  • Configure the layout of the Items List. Use the toolbar buttons to narrow down or widen the set of items to show. For example, show or hide files that exist in just one of the directories, equal files, or different files, etc.
  • Specify the parameter for comparison. In the Compare by drop-down list, select one of the possible options (contents, size, or time stamp).
  • Filter the folders' contents. To do that, type filtering string in the Filter text field, and press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter to apply it. Using the asterisk * wildcard to represent any number of characters is welcome.
  • To switch to another pair of folders to compare, update the fully qualified paths to them. Click the Browse button browseButton.png next to the Paths read-only fields and choose the required folders in the dialog that opens.
  • Explore the detected differences between files in the Differences Pane.

    Comparing folders

To synchronize the contents of folders
  1. For each pair of items, in the * field specify the action to apply. Click the icon in the field until the required action is set.
    Icon Action
    arrow_right Copy the item in the left side to the right side, possibly overwriting the contents of the corresponding target item, if it already exists.
    arrow_left Copy the item in the right side to the left side, possibly overwriting the contents of the corresponding target item, if it already exists.
    equal The items are treated identical with regard to the selected criterion of comparison. No action will be performed by default.
    not_equal The items differ with regard to the selected criterion of comparison. No action will be performed by default. Explore the differences in the Differences Pane and change the intended action by clicking the icon.
    close.png The item is present only in one of the folders and will be removed.
  2. Do one of the following:
    • To synchronize the currently selected item, click the Synchronize Selected button debug_resume.gif on the toolbar.
    • To synchronize all the items, click the Synchronize All button rerun.png on the toolbar.

See Also

Procedures:

Reference:

Web Resources: