Highlighting modified lines in Eclipse

EclipseIdeNetbeans

Eclipse Problem Overview


In netbeans, if I open a file which is under version control the lines which are modified are highlighted in the left. (green for new lines and blue for modified lines)

Is it possible to get a similar effect in Eclipse?

Eclipse Solutions


Solution 1 - Eclipse

  1. Open the Preferences window
  2. Search for "diff"
  3. Select Quick Diff
  4. Change the "Use this reference source" to a SCM provider (like CVS, SVN or Git)

By default, it compares to the latest version on disk, which, if you've saved the file, is no diff at all. You have to activate the comparison against a SCM repo. I'm not sure what happens if you more than one type of SCM since this is only a single selection.

Solution 2 - Eclipse

With Subversive, you can do Team > Show Annotations, and it will annotate the lines with the author and date of the last modification of that line.

Solution 3 - Eclipse

Right-click on the file > Team > Show annotation.
A brown tape will appear on the left-side of the code (it represents commited lines), and the modified lines will be shown in white.

Solution 4 - Eclipse

In Eclipse by using its Quick Diff feature. This is easy to do:

  1. Go to Window -> Preferences -> General -> Editors -> Text Editors -> Quick Diff. This is the dialog from where it can be configured.
  2. Turn on Quick Diff, by enabling the option Enable quick diff.
  3. Choose the version control system for which Quick Diff is needed from the dropdown Use this reference source. Git, SVN and CVS should be present here. Mercurial appears if the MercurialEclipse plugin is installed.
  4. The overview ruler is the ruler to the right of the scrollbar in the editor. If you would like to see the uncommitted lines to be marked on it, enable the option Show differences in overview ruler.
  5. Choose Apply and OK. Close all editor windows and reopen the source file that you want in the editor.

You should be able to see the newly added, modified or deleted lines marked in colors in the left bar on which line numbers are usually displayed. The colors used are the ones set in the Quick Diff dialog (see above steps). You can also view these uncommitted locations marked along the overview ruler on the right.

Solution 5 - Eclipse

EGit plugin's Quick Diff does exactly the same as netbans modified lines feature.

http://wiki.eclipse.org/EGit/User_Guide/State

Solution 6 - Eclipse

For Eclipse Version: 2019-03 (4.11.0) Go to

  1. Select 'window'
  2. Select 'Preferences'
  3. Go to General -> Editors -> Text Editors -> Quick Diff
  4. Tick 'Enable quick diff'
  5. Tick 'Show differences in overview ruler'
  6. If you want to keep the changes after you save your local copy, then you need to tell the eclipse to compare the local copy with the repository version. To do that change the reference source accordingly.

enter image description here

Solution 7 - Eclipse

There are at least two things you must do to get revision-based change highlighting (i.e., ones that do not disappear when the file is saved) to show up in Eclipse's "overview ruler" when using Git:

  1. Prior to import, make sure that Preferences > Team > Git > Projects > Automatically Share project that are located inside Git repositories is checked or import the project into your workspace using Import... > Git > Projects from Git (as pointed out by @cornelius in a comment on another answer)
  2. Enable Quick Diff and select "A Git Revision" as the reference source: Preferences > Editors > Text Editors > Quick Diff

Solution 8 - Eclipse

In eclipse too you will get the line highlighted which is changed util you save the file. and highlight is nothing but the change in color at the left panel of the editor before the start of that changed line.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSudarView Question on Stackoverflow
Solution 1 - EclipseDan AllenView Answer on Stackoverflow
Solution 2 - EclipsethSoftView Answer on Stackoverflow
Solution 3 - EclipseHakimView Answer on Stackoverflow
Solution 4 - EclipseVinit SolankiView Answer on Stackoverflow
Solution 5 - EclipseultraView Answer on Stackoverflow
Solution 6 - EclipseprimeView Answer on Stackoverflow
Solution 7 - EclipseDavid AvendasoraView Answer on Stackoverflow
Solution 8 - EclipseGuruKulkiView Answer on Stackoverflow