IntelliJ IDEA 13.1.0 Web Help

Annotation is a form of a file presentation that shows detailed information for each line of code. In particular, for each line you can see the version from which this line originated, user ID of the person who has committed that line, and the commit date. Shortly, annotated view of a file helps you find out who did what, and, moreover, trace back the changes.

Annotating lines of code is available for ClearCase, TFS, Mercurial, git, CVS, Perforce and Subversion.


The Annotate command appears in the VCS-specific nodes of the Version Control menu, file context menus, and the File History view. This command toggles between plain and annotated view of a file.

This section describes how to:

To show or hide file annotations
  1. Open the desired file in the editor.
  2. To show annotations, right-click the left gutter, and select the Annotate option:


    When the Annotate option for a file is selected, the file changes its view as shown below:


    1. The number of the changelist within which the annotated change has been checked in.
    2. The date when the annotated change has been checked in.
    3. The person who has checked the annotated change in.
    4. The revision number of the current file.
    5. An asterisk * indicates the changes checked in within the latest revision of the file.
  3. To hide annotations, right-click the annotations gutter, and choose Close Annotations on the context menu:


To show or hide annotation details
  1. Show annotations and switch to the Annotations gutter.
  2. On the context menu, choose View, then select or clear the following options to have the corresponding information displayed or hidden:
    The numbers of the changelists within which the annotated changes were checked in.
    Check-in date
    The names of the persons who checked in the annotated changes
    Commit number
    Commit numbers of particular files
    Background colors of annotations for each person who checked in a particular annotated change
    Choose the way of displaying the author name (first name, last name, or full name).
To view basic information in the tooltip
  • Hover the mouse pointer over an annotation. The following tooltip appears:


    The tooltip shows:
    1. The number of the changelist within which the annotated change was checked in.
    2. The check-in message provided with the changelist.


The annotation settings do not affect the range of information displayed in the tooltip.

To highlight revisions within the specified range
  1. Show annotations and switch to the Annotations gutter.
  2. To specify the range, select the Show before/Show after in the context menu and specify the required revision numbers. The revisions with numbers within the specified range are highlighted.
  3. To cancel highlighting, select Remove highlighting in the context menu.



    Using annotations to highlight a limited set of revisions is available for Subversion integration.

To view differences between revisions
  1. Show annotations and switch to the Annotations gutter.
  2. Position the cursor on the annotation in question and choose Show Diff on the context menu. IntelliJ IDEA opens the Differences Viewer for Files that shows the deviations between the annotated revision of the file and its previous revision.


To show annotation for a specific revision of a file
  1. Open the file history view.
  2. In the History tab, select the version you want to review and select Annotate on the context menu of the selected line.


See Also



Web Resources: