Search code examples
gitintellij-idea

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?


Solution

  • Though Jon Tirsen's answer is correct, you need to go through entire text in order to understand how to do that.

    Here's the images of the same in mac.

    1. I am currently working with hello_world and want to compare with master.

    UPDATE: In the new UI, click on Show Diff with Working Tree

    enter image description here

    1. Next a window will pop up. Select Files and press cmd + d

    enter image description here

    1. Another window which shows diff. You can perform many different types of diff. Use cmd + shift + ] and cmd + shift + [ to shift between files.

    enter image description here

    Diff Tip: IntelliJ provides advanced diff features. You can check those on the 3rd image.