IntelliJ: Viewing diff of all changed files betwee

2019-02-03 21:51发布

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?

4条回答
劳资没心,怎么记你
2楼-- · 2019-02-03 22:19

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. enter image description here

  2. 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.

查看更多
虎瘦雄心在
3楼-- · 2019-02-03 22:20

Right Click on the class and select the Git option where you will see compare with branch option where you can select the particular branch.

查看更多
We Are One
4楼-- · 2019-02-03 22:26

If you just want to compare your currently open file with another branch in a side-by-side fashion, just go to VCS -> Git -> Compare with Branch.

查看更多
放我归山
5楼-- · 2019-02-03 22:26

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.

查看更多
登录 后发表回答