Paul Stanley
Paul Stanley

Reputation: 4098

get all files in git diff in intellij

Is there a quick way to open all files with a diff between 2 commits in intellij?

Im looking at my diffs in gitlab and Im thinking itd be easier to just do the edits there, yet I want the benefits of the IDE so to speak.

Upvotes: 9

Views: 8241

Answers (3)

Alan Thompson
Alan Thompson

Reputation: 29958

This is easy to do through the IntelliJ IDEA menu system.

Suppose you are working on a branch cool-feat and you want to compare all files against branch master. Starting at the top menu, select:

VCS -> Git -> Branches

a pop-up menu will appear. Then, select:

master -> Compare with Current

A comparison window will open, showing all the commits since branch cool-feat was created. Select the tab Files, then select the first icon in the top-left corner under the word 'Difference', which looks like 2 arrows pointing inward (you can also use cmd-D). This brings up the file comparison window, with the current version of a file (branch cool-feat) on the left, and the version from master on the right (the git commit sha and lock symbol indicate this).

You can use the up/down arrays in the top left corner to jump between changed source lines. I have remapped keys alt-upArrow and alt-downArrow to make this easier.

Upvotes: 7

Supun Wijerathne
Supun Wijerathne

Reputation: 12938

I think this is the closest solution you can have.

  • Open Version Control tool window.
  • Go to Log tab.
  • You can see the network diagram. Select 2 commits that you want to compare.
  • Then from the right hand side you can see the list of diff files between 2 commits.

enter image description here

  • Further you can select a file from the list and, click on top left red color button (Diff button) on the file list window and see the diff for that file. And you can iterate forward and backward through the list of diff files by the next and back buttons (keyboard shortcuts too) on top left on diff window. :))

enter image description here

Upvotes: 16

Bobo
Bobo

Reputation: 462

VCS => Browse VCS Repository => Show Git Repository Log or Right clik on the file => local history => Show History for one file

Upvotes: 4

Related Questions