问题描述
使用 IntelliJ 的差异查看器是一种非常好的代码审查方式,因为您可以使用 IntelliJ 代码编辑器的所有功能(重构、完成等)在本地版本中进行更改.
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).
不幸的是,当您在 IntelliJ 中进行代码审查时,我还没有弄清楚如何做最重要的事情,即:查看工作树中所有更改文件的差异(检出到您想要查看的分支)合并自)和另一个分支(您计划合并到的分支,例如master").
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).
有人知道怎么做吗?
推荐答案
虽然 Jon Tirsen 的回答是正确的,但您需要通读全文才能理解如何做到这一点.
Though Jon Tirsen's answer is correct, you need to go through entire text in order to understand how to do that.
这是在 mac 中相同的图像.
Here's the images of the same in mac.
- 我目前正在使用 hello_world 并想与 master 进行比较.
更新:在新的用户界面中,点击Show Diff with Working Tree
UPDATE: In the new UI, click on Show Diff with Working Tree
- 接下来会弹出一个窗口.选择
Files
并按cmd + d
- 另一个显示差异的窗口.您可以执行许多不同类型的差异.使用
cmd + shift + ]
和cmd + shift + [
在文件之间切换.
- Another window which shows diff. You can perform many different types of diff. Use
cmd + shift + ]
andcmd + shift + [
to shift between files.
差异提示:IntelliJ 提供了高级差异功能.您可以在第三张图片上查看.
Diff Tip: IntelliJ provides advanced diff features. You can check those on the 3rd image.
这篇关于IntelliJ:查看本地和 git commit/branch 之间所有更改文件的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!