{"id":251631,"date":"2024-12-03T06:05:05","date_gmt":"2024-12-03T14:05:05","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=251631"},"modified":"2024-12-03T06:05:05","modified_gmt":"2024-12-03T14:05:05","slug":"introducing-the-copy-git-permalink-feature-in-visual-studio-17-12","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/introducing-the-copy-git-permalink-feature-in-visual-studio-17-12\/","title":{"rendered":"Introducing the Copy Git Permalink Feature in Visual Studio 17.12"},"content":{"rendered":"<p>We are excited to announce the release of the Copy Git Permalink feature in Visual Studio 17.12. This new functionality streamlines the process of sharing code references, enhancing collaboration and ensuring that critical context is preserved.<\/p>\n<h1><img decoding=\"async\" class=\"alignnone wp-image-251632\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-1.png\" alt=\"Git menu showing the Copy GitHub Permalink option\" width=\"900\" height=\"506\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-1.png 900w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-1-300x169.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-1-768x432.png 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/h1>\n<h2>Effortless Code Sharing<\/h2>\n<p>If you\u2019ve found yourself needing to share code snippets with colleagues, you know the challenges of preserving context. With the new Copy Git Permalink feature, you can now generate a permalink directly from Visual Studio to the remote repository. Simply select the desired code, right-click, and choose the \u201cCopy Permalink\u201d option under the Git submenu. Then, your colleague can open the link you shared to get to that line of code on the web, providing them with the surrounding code without disrupting their local environment.<\/p>\n<p>This feature supports both Azure DevOps repositories and GitHub (requires sign-in). If you\u2019d like the ability to extend the support for your own favorite Git hosting provider, please upvote this <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/VisualStudioExtensibility-Feature-reque\/10771452\">Visual Studio Extensibility suggestion ticket<\/a>.<\/p>\n<h2>Best Practices for Accuracy<\/h2>\n<p>To ensure that your permalink reflects the latest code, remember to commit and push your changes before generating the link. Visual Studio will automatically find the most recent commit on the web if your changes haven\u2019t been pushed recently.<\/p>\n<p>To include line and column numbers in your permalink, make sure the text of interest is selected.<\/p>\n<h2>Historical Code Reference<\/h2>\n<p>The Copy Git Permalink option is also available within the embedded commit details view in the Git Repository window. This allows you to reference specific code from previous commits without switching branches.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-251633\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-2.png\" alt=\"in the Branch explorer showing a real example where you would copy Git Permalink\" width=\"1431\" height=\"1014\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-2.png 1431w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-2-300x213.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-2-1024x726.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2024\/12\/word-image-251631-2-768x544.png 768w\" sizes=\"(max-width: 1431px) 100vw, 1431px\" \/><\/p>\n<h2>From Marketplace to Product<\/h2>\n<p>This started as a hackathon project of a Visual Studio engineer, Etienne Baudoux, which turned into <a id=\"post-251631-_Int_CuH5ntxn\"><\/a>the popular <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=EtienneBAUDOUX.CopyGitLink2022\">Copy Git Link extension<\/a>. The productivity gains experienced by internal Microsoft adopters and the votes received in a <a href=\"https:\/\/developercommunity.visualstudio.com\/t\/copy-url-to-azure-devops-repo-file-view-from-visua\/975364\">related suggestion ticket<\/a> made it clear that an in-box alternative to this extension would be appreciated.<\/p>\n<h2>Conclusion<\/h2>\n<p>We encourage you to explore the new Copy Git Permalink feature and share your feedback with us. We are committed to enhancing your development experience and look forward to hear your thoughts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce the release of the Copy Git Permalink feature in Visual Studio 17.12. This new functionality streamlines the process of sharing code references, enhancing collaboration and ensuring that critical context is preserved. Effortless Code Sharing If you\u2019ve found yourself needing to share code snippets with colleagues, you know the challenges of [&hellip;]<\/p>\n","protected":false},"author":59539,"featured_media":251632,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6961,155],"tags":[431],"class_list":["post-251631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","category-visual-studio","tag-git"],"acf":[],"blog_post_summary":"<p>We are excited to announce the release of the Copy Git Permalink feature in Visual Studio 17.12. This new functionality streamlines the process of sharing code references, enhancing collaboration and ensuring that critical context is preserved. Effortless Code Sharing If you\u2019ve found yourself needing to share code snippets with colleagues, you know the challenges of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/251631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/59539"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=251631"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/251631\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/251632"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=251631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=251631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=251631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}