Search code examples
gitvisual-studio-codeintellij-idea

VSCode like file change viewer setting for intellij


I'm really fond of IntelliJ to do all programming stuff, however what I do feel it could derive from VS Code is the file change viewer (Left VS Code, IntelliJ right)

enter image description here

  • Vscode has clear has sections differentiating the staged/unstaged files, IntelliJ has color codes + sections which aren't clear
  • Clicking on the file in this section in VS Code brings the diff viewer, while in IntelliJ, you have to right-click -> git -> diff
  • Vscode has an easy side button to stage a file, while IntelliJ has right-click -> git -> add

So far, I've been using code for just viewing diffs before I commit, yet I'd like to not leave IntelliJ at all if I could get this exact customization in or use some plugins that give me this. (The diff viewer in IntelliJ is the best, however it's not very accessible like in code)

Is there any way to do this?


Solution

  • I'm going to address each point one by one:

    1. Unfortunately, IntelliJ doesn't provide a view option to split changes into two groups (staged and unstaged files). At most, you can group files by directory or module by clicking on the eye icon above the changes list, but this is not what you're looking for.

    2. If you want to open the diff viewer on a file, just double-click on the file from the changes list. You don't need to do right-click > git > diff. Alternatively, you can set up a hotkey to show the differences for the current file. Just go to File > Settings > Keymap and either search for Compare with the Same Repository Version, or keep browsing to Version Control Systems > Git > Compare with the Same Repository Version. Then, assign a hotkey.

    3. If you need to stage a file, just check the checkbox on the left of the file from the changes list. You don't necessarily need to do right-click > git > add. Alternatively, you can use the hotkey CTRL + ALT + A to stage the current file, and even though it won't be shown as checked in the changes list, if you run git status you can see that the file is actually staged.