Pierre-Antoine
Pierre-Antoine

Reputation: 8129

Is there a way to highlight git changed line in Intellij

I have a big configuration file in IntelliJ which I am editing.

Is it possible to highlight the lines that I changed, in a way similar to a git diff directly in the editor?

Note that I am aware that IntelliJ shows the changed lines on the side of the editor (nice feature btw!). Here I am however looking for something more prominent, that would highlight the changed lines (eg by changing the background color) directly in the editor. The motivation is to enable to spot exactly what line was already changed while editing the file.

Upvotes: 13

Views: 18576

Answers (4)

Sergey K.
Sergey K.

Reputation: 2023

For lines in the editor: Settings/Preferences | Editor | General | Highlight modified lines in gutter.

From https://www.jetbrains.com/help/pycharm/file-status-highlights.html

Upvotes: 16

HA S
HA S

Reputation: 1267

Usually, I look at the green bar near the right vertical scroller, it shows where the changes are made. It helps me to keep track of where I made changes to the file.

I hope it might help someone.

Upvotes: 2

Dmitrii Smirnov
Dmitrii Smirnov

Reputation: 7558

No, there is no way to highlight lines in Editor in the same way as in Diff. Showing all the diff in the editor will be too distracting most likely. And there is specific Diff view for that purpose. Somewhat similar request - https://youtrack.jetbrains.com/issue/IDEA-140053

The motivation is to enable to spot exactly what line was already changed while editing the file.

Markers in the gutter are there exactly for this purpose. Changed sections are also marked on the scrollbar. You could change the color to be more noticeable, btw.

Upvotes: 3

petre
petre

Reputation: 508

Go to Version Control -> Local Changes. Right click on the file you change and show diff (or CTRL + D when the file is selected).
Then you'll see the differences with the current version in editable mode, and you can resize the left window to have the right one on full screen.

Version Control IntelliJ

Upvotes: 3

Related Questions