Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visualising changed/added/removed Git lines in IntelliJ IDEA

Is there analog of vim-gitgutter for IntelliJ IDEA?

You can see in the screenshot how vim-gitgutter marks changed/added/removed lines using symbols '~', '+' and '-'. I would like to get something like that in IDEA.

enter image description here

Thanks!

like image 706
zhur Avatar asked Dec 12 '15 06:12

zhur


People also ask

How do I see Git changes in IntelliJ?

IntelliJ IDEA allows you to review all changes made to the project sources that match the specified filters. For distributed version control systems, such as Git and Mercurial, you can view project history in the Log tab of the Version Control tool window Alt+9 (see Investigate changes in Git repository).

How do I see Git staging in IntelliJ?

You can use Find Actions which is ⌘⇧A (macOS), or Ctrl+Shift+A (Windows/Linux) and then search for 'Git Staging' to enable Git Staging instead of IntelliJ IDEA Changelists.

How can I see local commits in IntelliJ?

If you press Ctrl+K , the entire active changelist will be selected. You can also select files under the Unversioned Files node — IntelliJ IDEA will stage and commit these files in one step. If you want to append local changes to the latest commit instead of creating a separate commit, select the Amend option.


2 Answers

You need to set up version control for your project. You can do that in "File" -> "Settings..." -> "Version control" -> then set "VCS" to "Git" (or any other supported VCS). Once you have done that, the editor shows color bands for changed lines (green for added, blue for changed, red for removed). See also the IntelliJ manual page.

like image 88
uwolfer Avatar answered Oct 11 '22 15:10

uwolfer


If the gutter marks are missing this could be caused by plugins. I was able to get them back by enabling in settings (in Webstorm):

Editor > General > Gutter (bottom) > Highlight modified lines in gutter

like image 36
Jurrian Avatar answered Oct 11 '22 15:10

Jurrian