IntelliJ IDEA 2017.1 Help

Adding Tags

On this page:


The Git integration supports tagging a particular commit or object to refer to it in the future. Basically, by adding a tag you create a branch that never moves.

You can also create annotated tags and have annotations displayed to facilitate viewing and navigating through tagged commits.

Assigning tags to commits

To assign a tag to a commit

  1. On the main menu, choose VCS | Git | Tag Files. The Tag dialog box opens.
  2. From the Git Root drop-down list, select the required local repository.

    The Current Branch read-only field shows the branch you are currently working with in the selected repository. The contents of the read-only field change as you change the selection in the Git Root drop-down list.

  3. In the Tag Name text box, type the name of the new tag.
  4. In the Commit text box, specify the commit or object which you want to tag:
    • To tag the latest commit in the branch (HEAD), leave the text box empty.
    • To tag a particular commit, specify its commit hash or use an expression, for example, of the following structure: <branch>~<number of commits backwards between the latest commit (HEAD) and the required commit>.

      Refer to the Git commit naming conventions for details.

  5. To check that the specified commit exists and is the one you actually need, click the Validate button. The Paths affected in commit dialog box shows the files that were affected in the specified commit. View the information and click OK.

    If you specify a commit that does not exist, IntelliJ IDEA displays an error message.

Creating annotated tags

To create an annotated tag

  1. Create a tag.
  2. In the Message text box, provide a description of the commit.

See Also

Last modified: 18 July 2017