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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.