Compare Directories
for IntelliJ IDEA

Compatible with all products except MPS
37 178

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.

Hi Val, This was due to opening diffs on files whose type is unknown to IDEA. This new plugin release should avoid this weird IDEA behaviour (alongside with fixing a few lambda management bugs). Please tell me if you face any further issue. Best regards, Olivier.
The interface is great but the plugin causes the entire project to re-index every time you look at a file, even if you don't change it and even if the file isn't even part of the project you are in. This makes it unusably slow.
Hi Stefano, In short: it's really fast, it's nicer (thanks to the tree view), it supports zip/jar files within zip/jar files, it supports huge files without requiring a huge amount of memory, it detects differences in comments only and it can even compare attributes/methods within Java classes by disassembling them (and you can see the differences!)
Hello! How different is this from the bundled folder compare too? Thanks!
Sorry guys, I was off the field for a year now. Now I'm back and the plugin too!
Doesn't work with IntelliJ 11.
I used this plug-in allot in the past, but it doesn't seem to work anymore :(. What a pity!
I love this plugin! Unfortunately it hasn't worked in the last several versions of IntelliJ. I'm running IntelliJ 11.1 and plugin 1.0.4. When I try to compare two directories I get this:

08:48:56 PluginException: org.intellij.idea.dirdiff.action.CompareDirectoryMenuBarAction: group with id "SearchMenu" isn't registered; action will be added to the "Other" group [Plugin: Compare Directories]: org.intellij.idea.dirdiff.action.CompareDirectoryMenuBarAction: group with id "SearchMenu" isn't registered; action will be added to the "Other" group [Plugin: Compare Directories]
08:49:20 NoClassDefFoundError: Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(312,825),absolute(304,817),button=1,modifiers=Button1,clickCount=1] on frame0: com/intellij/ui/TreeToolTipHandler
Nice tool, but I wish there was a way to not compare recursively. I have two directories I want to compare, but they both contain sub-directories that I don't want compared.
Thank you!
Excellent! After installing new version 1.0.3 (93.13.) I can confirm the plugin works under Linux as well (uninstalled 1.0.2 and installed new 1.0.3 through plugin manager).Thank you very much.
This is odd... The plugin works fine with IDEA 9 under Windows. Looks like the faulty IDEA class still exists in the IDEA-9 Windows distribution (though it has become deprecated) but has been removed from the Linux distribution.

I found a replacement class in IDEA 9 that should fix the issue, but since I have no easy access to a Linux workstation with IDEA installed on it, I cannot make sure the problem is fully solved. :-( All I can do is making sure the plugin works fine under the Windows distribution of IDEA-9.

I'm about to publish an IDEA-9-specific version of the plugin containing the fix. Could you tell me if it is fine then? Thanks.
Actually it looks like previous version (1.0.2) works in Idea Community Edition on Linux.
Unfortunately cannot use plugin (1.0.3) with IC-95.429 (on Linux).

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(115,270),absolute(115,270),button=1,modifiers=Button1,clickCount=1] on frame0: com.intellij.ui.TreeSpeedSearch.(Lcom/intellij/util/ui/Tree;Lcom/intellij/util/containers/Convertor;Z)V
java.lang.NoSuchMethodError: com.intellij.ui.TreeSpeedSearch.(Lcom/intellij/util/ui/Tree;Lcom/intellij/util/containers/Convertor;Z)V
at org.intellij.idea.dirdiff.view.CompareDirectoryPanel$UI.createUI(

Anybody having similar problem? Is it possible to use plugin with Community Edition?
leszekgruchala, part of your wish has been granted: a new version of the plugin is about to be released with many improvements, including the ability to classify differences in comments as "non-significant differences" (and show them separately from "identical" and "different" files.)

Unfortunately, leszekgruchala, coldserenity, this version cannot compare folders stored in VCS. I didn't yet find a way to retrieve folder structure and file content which is simple, efficient, VCS-independent and working with IDEA 7, 8 and 9 all at the same time. Until then, you still have to retrieve complete snapshots of the source-controlled folder trees you want to compare.
Please  sign in  to leave a comment.