Compare Directories

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
Mar 29, 2016
25 006

Allows the fast comparison of two directories or archive files (jar, zip, war... and also tar/gz) based on file contents. Compared directories/archives are shown in a tree view to give a better and easier-to-read overall view of the differences.
Compared directories/archives may contain archives in archives in archives in..., which are all opened and compared compressed file by compressed file.
In IntelliJ IDEA, compiled Java class files can also be compared at the attribute/method level (option when starting the comparison).
Comparisons can be run on any file or directory inside or outside the current project.

From the comparison tree view, single file differences (on both text and binary files) can easily be viewed and edited with the usual IDEA diff window. Left-side and right-side files can be separately opened as easily.
You can also view differences in compiled Java class structure and bytecode using the usual IDEA diff window, thanks to the built-in Java disassembler.
Blank-only differences in text files are detected, as well as user-defined differences in text files and differences in source file comments, called «non-significant differences».
The plugin provides some basic mass-merging facilities on compared files and directories (copy/delete on compared files or directories).

This plugin works on any IntelliJ Platform product, except the Java disassembler, which is only available on IntelliJ products bundled with Java ASM4 library.

For more information, please read the online help bundled with the plugin (complete plugin sources are also bundled for the IDEA plugin developers' convenience).

Download plugin

Recent change notes

Fixed regression introduced in previous release when opening diffs under non-Java IntelliJ-Platform-based products, such as PhpStorm.

General usage instructions

Execute the Compare Directories... menu command, select two directories or zip/jar/tar files containing files with the same file names and see the comparison results on the opened Compare Directories panel:
   • Files and directories are shown depending on the differences in their contents: identical, different by blanks only, non-significantly different, different, left-only, right-only.
   • Compared text file can be then edited within IDEA.
   • Compared text file differences can be then viewed with the usual IDEA diff window.
   • Compared class bytecode differences can be also viewed with the usual IDEA diff window.
   • Files and directories can be copied from one side to the other.
You will find many more details in the bundled help pages.

   • When a file has been renamed between 2 compared directories or archives and belongs to the same directory node, the left-only node and right-only node can be merged. Merged nodes can be split later on if necessary.
   • In programming source files, differences in comments can be considered non-significant, to distinguish them from differences in programming instructions. See the non-signicantly diffs of the compare-directory settings dialog box to activate it.

Open: File > Settings > Plugins
Click on the button “Browse repositories”, find the “Compare Directories” plugin in the available plugins list, right click on it and choose install.

Note: the latest plugin versions require IDEA 14 or more.