{"id":33515,"date":"2017-06-14T21:24:50","date_gmt":"2017-06-14T21:24:50","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/devops\/?p=33515"},"modified":"2019-02-14T15:51:33","modified_gmt":"2019-02-14T23:51:33","slug":"view-tags-for-git-repositories","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/view-tags-for-git-repositories\/","title":{"rendered":"View tags for git repositories"},"content":{"rendered":"<p>Git repositories now show tags that allow you to mark important points in your repo&#8217;s history. Now\u00a0you can easily bookmark a specific commit in your git repository to compare to other commits in the future. In this post, I will talk about how you can easily manage following git tag related tasks in VSTS :<\/p>\n<ul>\n<li>create tag<\/li>\n<li>view tag<\/li>\n<li>delete tag<\/li>\n<li>manage tag security<\/li>\n<\/ul>\n<h3>Create a tag<\/h3>\n<p>If you know the commit that needs to be tagged then you can simply browse to the commit, click on the context menu, and click on <strong>Create tag<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/01CreateTag3.png\"><img decoding=\"async\" class=\"alignnone wp-image-33605 \" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/01CreateTag3.png\" width=\"748\" height=\"218\" \/><\/a><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/01CreateTag2.png\"><\/a><\/p>\n<p>You can also create a tag from the commit list view by clicking on <strong>Create tag<\/strong> from the context menu.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/02-ContextMenu1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33615 \" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/02-ContextMenu1.png\" width=\"756\" height=\"361\" \/><\/a><\/p>\n<p>You can also create a tag from the Tags page by clicking on the Create tag button on the top left of the page.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/03-TagsPage1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33625 \" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/03-TagsPage1.png\" width=\"791\" height=\"233\" \/><\/a><\/p>\n<p>The <strong>Create a tag<\/strong> dialog allows you to tag a commit. In VSTS you can only create <em>annotated tags<\/em> from this dialog. If you need to push <em>lightweight tags<\/em> to your remote repository, then you can create a lightweight tag and push it from the command line to show up in VSTS.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/04CreateTagDialog1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33635\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/04CreateTagDialog1.png\" width=\"442\" height=\"283\" \/><\/a><\/p>\n<p>If you are not sure which commit to tag but are certain that you need to tag the latest commit in a branch, then click on <strong>Tag from<\/strong> dropdown and select the <strong>All branches<\/strong> tab. Next, you can simply filter to the branch name that you want to tag. This will tag the latest commit on the selected branch.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/05-AllBranches1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33645\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/05-AllBranches1.png\" width=\"436\" height=\"380\" \/><\/a><\/p>\n<h3>View tags<\/h3>\n<p>Once a commit is tagged, the tag shows up on the commit details page and commit list view. You can click on a tag to see the tag details i.e. the tag name, tag message, tagger and tagged date.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/06-TagsCommitDetails1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33655\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/06-TagsCommitDetails1-1024x307.png\" width=\"709\" height=\"213\" \/><\/a><\/p>\n<p>You can view all the tags on your repository on the <strong>Tags page<\/strong>. If you manage all your tags as releases, then the tags page gives a bird\u2019s eye view of all the releases.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/09-ContextMenu3.png\"><img decoding=\"async\" class=\"alignnone wp-image-33706\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/09-ContextMenu3-1024x285.png\" width=\"771\" height=\"215\" \/><\/a><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/09-ContextMenu2.png\"><\/a><\/p>\n<p>You can easily differentiate between a lightweight and an annotated tag here as a<em>nnotated tags<\/em> show the tagger and the creation date alongside the associated commit while <em>lightweight tags<\/em> only show the commit information.<\/p>\n<p>There are several other operations that you can perform on tags from VSTS such as :<\/p>\n<ol>\n<li>comparing commits and changes between any two tags<\/li>\n<li>create a new branch from the tag<\/li>\n<\/ol>\n<h3>Delete tags<\/h3>\n<p>Occasionally, there can be times when you want to delete a tag from your remote repo. It could be due to a typo in the tag name or you you might have tagged the wrong commit. You can easily delete tags from the VSTS UI by clicking on the context menu of a tag on the Tags page and clicking on Delete tag.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/10-DeleteTags1.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-33665\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/10-DeleteTags1-1024x394.png\" width=\"879\" height=\"338\" \/><\/a><\/p>\n<p><strong>Note<\/strong>: Deleting tags on remote repos should be exercised with caution.<\/p>\n<h3>Filtering tags<\/h3>\n<p>For old repositories, the number of tags can grow significantly with time or there are repositories that have tags created in hierarchies which can make finding tags difficult. If you are unable to find the tag that you were looking for on the tag page, then you can simply Search tag name using the filter on the <strong>Tags page<\/strong>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/11-FilterTags1.png\"><img decoding=\"async\" class=\"alignnone size-large wp-image-33675\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/11-FilterTags1-1024x253.png\" width=\"879\" height=\"217\" \/><\/a><\/p>\n<h3>Tags security<\/h3>\n<p>Now you can grant granular permissions to users on the repo to manage tags.<\/p>\n<table width=\"943\">\n<tbody>\n<tr>\n<td width=\"65\">Create tag<\/td>\n<td width=\"878\">Browse to <strong>Settings<\/strong> -&gt; <strong>Version Control <\/strong>and click on the repository where you want to grant permission.<\/p>\n<p>Select a user and set the <strong>Create tag<\/strong> permission to allow or deny.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/12-CreateTags1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33685\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/12-CreateTags1.png\" width=\"765\" height=\"353\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"65\">Delete tags &amp; Manage permissions<\/td>\n<td width=\"878\">You can manage granularly at the repo level as to who can delete tags.<\/p>\n<ul>\n<li>Browse to <strong>Settings<\/strong> -&gt; <strong>Version Control <\/strong>and click on the repository where you want to grant permission.<\/li>\n<li>Next click on <strong>All tags<\/strong> option<\/li>\n<li>Select a user and set the <strong>Force push (rewrite history, delete branches and tags) <\/strong>permission to allow or deny<\/li>\n<li>Select a user and set the <strong>Manage permissions <\/strong>permission to allow or deny<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/13-Forcepush1.png\"><img decoding=\"async\" class=\"alignnone wp-image-33695\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/06\/13-Forcepush1-1024x437.png\" width=\"811\" height=\"346\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Got feedback?<\/h3>\n<p>How can we make git tags experience better for you? Here is how you can get in touch with us<\/p>\n<ul>\n<li>You can<span>\u00a0<\/span><a href=\"mailto:vc_feedback@microsoft.com\">send a mail<\/a><span>\u00a0<\/span>or<\/li>\n<li><a href=\"https:\/\/developercommunity.visualstudio.com\/spaces\/21\/index.html\">Ask questions on support forum<\/a><span>\u00a0<\/span>or<\/li>\n<li><a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=698652\">Post your suggestion ideas<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Git repositories now show tags that allow you to mark important points in your repo&#8217;s history. Now\u00a0you can easily bookmark a specific commit in your git repository to compare to other commits in the future. In this post, I will talk about how you can easily manage following git tag related tasks in VSTS : [&hellip;]<\/p>\n","protected":false},"author":227,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-33515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>Git repositories now show tags that allow you to mark important points in your repo&#8217;s history. Now\u00a0you can easily bookmark a specific commit in your git repository to compare to other commits in the future. In this post, I will talk about how you can easily manage following git tag related tasks in VSTS : [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/33515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/227"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=33515"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/33515\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=33515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=33515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=33515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}