Comparing files and folders

When you develop a project, often there is a need to compare the contents of the files or the structures of the folders. Usually, you would have to use an external tool for that, and there are plenty of such tools in the market. IntelliJ IDEA provides its own file diff and folder synchronization features. Let's start with comparing files.

Comparing files

To compare two files, select them keeping the Ctrl key pressed in the project structure tree and choose Compare Two Files from the context menu; or press Ctrl + D (PC) or cmd + D (Mac). The differences viewer will open with the differences highlighted:

Comparing files

You can move between ...

Get IntelliJ IDEA Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.