WestCoastProjects
WestCoastProjects

Reputation: 63042

How to view all differences between two git commits within Intellij?

I looked at a few results for how to do the task in the title. One of the most popular is an SOF answer here:

https://stackoverflow.com/a/49642681/1056563

In particular there is this popup shown:

enter image description here

However when I do apparently the same process the popup does not include those compare options:

enter image description here

What do I need to do to get the compare commits option? I am on Intellij Ultimate 2020.2 on macOS.

Update The (now rather tentatively..) accepted answer refers to a link to Compare Versions. Here is my attempt to replicate those instructions. However there is no "compare versions" option afaict:

enter image description here

Upvotes: 2

Views: 690

Answers (2)

Ragul R
Ragul R

Reputation: 82

Review the differences between two commits (From IntelliJ docs)

IntelliJ IDEA allows you to check which files were modified between two commits instead of having to browse the changes in each commit in between.

Select any two commits in the Log tab of the Git tool window ⌘(Сmd) 9 and choose the 2 commits you want to compare Versions from the context menu.

The Changes tool window with a list of files modified between the selected commits opens.

You can view the diff for any file by clicking the Show diff icon or pressing ⌘(Сmd) D.

Upvotes: 1

Ruslan Kuleshov
Ruslan Kuleshov

Reputation: 2405

If you would like to compare two commits in IDE then please open Git toolwindow, find in a log desired commits, select them while holding Ctrl and then you can hit cmd/Ctrl+D or right-click and choose "Compare version". Please see more here about commit and history review enter image description here

Upvotes: 2

Related Questions