Working with Git tags

Azure Repos | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | VS 2017 | VS 2015

Azure DevOps Services and TFS support 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, and starting with Visual Studio 2017 Update 6, 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 Services, TFS, 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

Project URLs have changed with the release of Azure DevOps Services and now have the format dev.azure.com/{your organization}/{your project}, but you can still use the existing visualstudio.com format. For more information, see Visual Studio Team Services is now Azure DevOps Services.

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.

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

Note

Project URLs have changed with the release of Azure DevOps Services and now have the format dev.azure.com/{your organization}/{your project}, but you can still use the existing visualstudio.com format. For more information, see Visual Studio Team Services is now Azure DevOps Services.

View tags in the Tags view

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

    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 Code, 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.

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. To create a lightweight tag, you can use Git command line or Visual Studio.

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.

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. To create a lightweight tag, you can use Git command line or Visual Studio.

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 from the Tags view.

  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 branch are also automatically inherited by the branch 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

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.

  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

  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