Use Git tags

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Visual Studio 2019 | Visual Studio 2022

Azure DevOps supports both annotated and lightweight tags. Lightweight tags are a pointer to specific commit, while annotated tags contain more information such as the tagger, message, and date. You can create annotated tags using the web portal. You can create both lightweight and annotated tags from within Visual Studio. For more information on Git tags, see 2.6 Git Basics - Tagging from the Pro Git book.

This article provides an overview of working with Git tags in Azure DevOps and Visual Studio.

Important

The Tags view in Visual Studio was introduced in Visual Studio 2017 Update 6. If you are on versions earlier than this, you can view and create tags from the history and commit details views starting with Visual Studio 2015, but you won't be able to perform the operations in the Tags view as described in this article.

View and filter tags

You can view tags in the Tags view and in the Commits view in the web portal.

Note

With Azure DevOps Services, the format for the project URL is dev.azure.com/{your organization}/{your project}. However, the previous format that references the visualstudio.com format is still supported. For more information, see Introducing Azure DevOps, Switch existing organizations to use the new domain name URL.

View tags in the Tags view

  1. To view the tags in your repo, navigate to your project in the web portal, choose Repos, Tags, and select the desired repo.

    View tags in Tags view.

    Annotated tags are displayed with a tag name, message, commit, tagger, and creation date. Lightweight tags are displayed with a tag name and commit.

  2. To filter the list of tags, type a search term into the Search tag name box and press Enter.

    Filter tags

View tags in the Commits view

To view tags for a specific branch in the Commits view, navigate to your repo in the web portal, choose Repos, Commits, and select your branch.

View tags in Commits view.

Create tag

To create a tag, you must have the Create Tag permission, which is included by default in the Contributors group and higher.

Note

Tag names can't contain ASCII control characters, such as spaces, tildes, and colons. It's common practice to use lowercase characters and to separate words with a hyphen. Tag name length shouldn't exceed 250 ASCII characters. To avoid ambiguity between tag names and commit hashes, don't use tag names that consist of 40 hexadecimal characters. For more information on tag naming, see git-check-ref-format.

You can create annotated tags using the web portal from both the Tags view and the Commits view.

Important

You can only create annotated tags in the web portal or Visual Studio. To create a lightweight tag, you can use Git command line.

Create tags from the Tags view

  1. Select Create Tag from the Tags view in the web portal to create a new annotated tag.

    Create tag

  2. Specify a Name, select the branch to Tag from, enter a Description (required since you are creating an annotated tag), and select Create.

    Select Create.

  3. The new tag is displayed in the tag list.

    View new tag

Create tags from the Commits view

To create a tag directly from the commits view, right-click the desired tag and choose Create tag.

Create tag from the Commits view.

Delete tag

Important

Use caution when deleting tags from your repo. If the repo has been pulled, forked, or cloned by another user, the tag will still exist in their copy of the repo. You should only delete local tags, or if you are sure that the repo hasn't been pulled, cloned, or forked since you created your tag.

To delete a tag, you must have the Force Push permission at the Repository level or the All tags level (which inherits its permissions from the repository level if not explicitly set). Force push permissions for a tag are also automatically inherited by the tag creator.

Delete a tag in the remote repo

The steps in this procedure show you how to delete a tag in the remote repo using the Azure DevOps Services web portal.

  1. To delete a tag, select the ellipsis to the right of the tag name and choose Delete tag.

    Delete tag

  2. Select Delete to confirm.

    Select Delete.

  3. The tag is deleted, and won't be displayed the next time you navigate to the Tags view.

    Tag deleted

Create branch from a tag

  1. To create a branch from a tag, select the ellipsis to the right of the tag name and choose New branch.

    New branch from tag

  2. Specify a Name, optionally select any Work items to link, and choose Create branch.

    Choose Create branch.

  3. The branch is created and you are taken to the new branch in the web portal.

    Branch created.

View tag history

  1. To view the history for a tag, select the ellipsis to the right of the tag name and choose View history.

    View tag history

  2. You are taken to the commits view for the tag.

    Tag history