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.

    Screenshot of tags navigation in the web portal.

    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.

    Screenshot of filter tags in the web portal.

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.

Screenshot of tags in the Commits view in the web portal.

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.

    Screenshot of create tag button in the web portal.

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

    Screenshot of create tag dialog in the web portal.

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

    Screenshot of new tag in the web portal.

Create tags from the Commits view

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

Screenshot of create tag from commits view in the web portal.

You can programmatically create annotated tags via the Azure DevOps REST API. To create tags via an Azure pipeline using the git tag command. For more information, see git tag.

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). The creator also inherits Force push permissions for a tag.

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.

    Screenshot of delete tag in the web portal.

  2. Select Delete to confirm.

    Screenshot of delete tag confirmation in the web portal.

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

    Screenshot of tag deleted in the web portal.

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.

    Screenshot of create branch from tag selection in the web portal.

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

    Screenshot of create branch from tag dialog in the web portal.

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

    Screenshot of branch created from tag in the web portal.

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.

    Screenshot of view tag history in the web portal.

  2. You're taken to the commits view for the tag.

    Screenshot of tag history in the web portal.