Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: Viewing diff of all changed files between local and a git commit/branch

Using IntelliJ's diff viewer is a very nice way to review code because you can make changes in your local version with all the capabilities of the IntelliJ code editor (refactoring, completion, etc).

Unfortunately I have not worked out how to do the most important thing when you're doing code reviews in IntelliJ, namely: Looking at the diff of all the changed files in the working tree (checked out to the branch you want to merge from) and another branch (the branch you plan to merge into, e.g. "master).

Does anyone know how to do this?

like image 274
Jon Tirsen Avatar asked Mar 22 '12 15:03

Jon Tirsen


People also ask

How do I view Git diff in IntelliJ?

To open the Diff & Merge page, open settings by pressing Ctrl+Alt+S and navigate to Tools | Diff & Merge. Click this button to scroll both differences panes simultaneously.

How do I compare file changes in IntelliJ?

Compare the current revision of a file or folder with a revision in the same branch Select a file or a folder in the Project tool window, and choose <your_VCS> | Compare With from the context menu. Choose a revision you want to compare the current file or folder version with from the dialog that opens.

How do I see committed changes in IntelliJ?

IntelliJ IDEA lets you review the state of your project at a selected revision. Open the Git tool window Alt+9 and switch to the Log tab. Select a commit and choose Show Repository at Revision from the context menu.

How do you find a list of files that has been changed in a particular commit?

Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command.


1 Answers

This has now been implemented. In order to compare two branches you do:

  1. Check out one of the branches you want to compare with.
  2. Select the branch you want to compare with in the Git branch popup in the status bar in the bottom right of the IntelliJ window. A popup with some options is shown.
  3. Select the "Compare" option.
  4. This by default shows all the commits you can also select the "Diff" tab to show the actual changes.

This is all described in much greater detail in one of their blog posts.

like image 160
Jon Tirsen Avatar answered Sep 29 '22 01:09

Jon Tirsen