gitintellij-idea

Can Intellij IDEA show me the changes of the last x commits as if they were just made?


I am about to have an over-the-shoulder code review but my changes consist of multiple commits. It would be convenient if IntelliJ IDEA could show them all to me as if they were new changes because they would be a lot easier to find that way.

Does IntelliJ have a built-in way to do the equivalent of this:

git checkout -b temp-for-code-review
git reset --soft HEAD~x #x is a number of commits I want reviewed

If I do this in Git, IntelliJ IDEA will show changes exactly the way I want, but I'm wondering if there's a way to do this built into IntelliJ.


Solution

  • You can checkout a new branch in the usual way from the bottom right selector:

    Git checkout new branch

    And then do a soft reset from the menu VCS > Git > Reset HEAD. You can then choose the options to do what you'd like in the command line, eg:

    Git Reset Head