{"id":246144,"date":"2023-11-28T08:00:49","date_gmt":"2023-11-28T16:00:49","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=246144"},"modified":"2023-12-18T09:43:52","modified_gmt":"2023-12-18T17:43:52","slug":"write-your-git-commits-with-github-copilot","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/write-your-git-commits-with-github-copilot\/","title":{"rendered":"Write Your Git Commits with GitHub Copilot"},"content":{"rendered":"<p>After spending hours on a bug fix or a feature update, often the last thing we developers want to do is carefully explain the contents of the Git commit. The latest Visual Studio preview is here to help. Use the new generated Git commit message feature to help you describe your set of changes. You can then refine the message with &#8220;why&#8221; the change was made and commit.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/AI-Generated-Commit-1.gif\"><img decoding=\"async\" class=\"wp-image-246159 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/AI-Generated-Commit-1.gif\" alt=\"Image AI Generated Commit 1\" width=\"1037\" height=\"583\" \/><\/a><\/p>\n<p>Generating useful and informative commit messages helps you in a variety of ways.<\/p>\n<ul>\n<li>You avoid your repository looking like this<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Screenshot-2023-11-27-102528.png\"><img decoding=\"async\" class=\"alignnone wp-image-246146\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Screenshot-2023-11-27-102528-300x206.png\" alt=\"Poor Git history example\" width=\"481\" height=\"330\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Screenshot-2023-11-27-102528-300x206.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Screenshot-2023-11-27-102528-1024x702.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Screenshot-2023-11-27-102528-768x527.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Screenshot-2023-11-27-102528.png 1445w\" sizes=\"(max-width: 481px) 100vw, 481px\" \/><\/a><\/p>\n<ul>\n<li>Your teammates can more effectively review your changes in a pull request<\/li>\n<li>Your Git history tells a story that includes both \u201cwhat\u201d was changed and \u201cwhy\u201d<\/li>\n<li>You can easily pinpoint the origins of a bug or breaking change<\/li>\n<li>You save yourself and\/or coworkers hours of digging around while troubleshooting<\/li>\n<li>You make your repository easier to ramp up to and contribute to in the future<\/li>\n<\/ul>\n<p><div class=\"alert alert-success\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Lightbulb\"><\/i><strong>Enable the feature<\/strong><\/p>This feature is currently only available in preview. Ensure it&#8217;s enabled in Tools &gt; Options &gt; GitHub &gt; Copilot chat &gt; Enable commit message suggestions<\/div><\/p>\n<p>To try it out, download the latest Visual Studio preview and update the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=GitHub.copilot-chat\">GitHub Copilot Chat Extension<\/a>. You\u2019ll also need an active <a href=\"https:\/\/github.com\/features\/copilot?utm_source=vscom&amp;utm_medium=hero&amp;utm_campaign=cta-get#pricing\">GitHub <\/a>Copilot subscription.<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/vs2022preview\" target=\"_blank\">Download the Latest Visual Studio Preview<\/a><\/div><\/p>\n<h3>What is the generated Git commit message feature?<\/h3>\n<p>The new Generated Commit Message feature uses GitHub Copilot AI to describe your code changes. \u00a0This makes writing descriptive and helpful commit messages as easy as clicking a button, then adding your explanation.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generated-Commit-Message.png\"><img decoding=\"async\" class=\"alignnone wp-image-246147 \" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generated-Commit-Message-300x134.png\" alt=\"generated Git commits with GitHub Copilot\" width=\"385\" height=\"172\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generated-Commit-Message-300x134.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generated-Commit-Message-1024x457.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generated-Commit-Message-768x343.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generated-Commit-Message.png 1317w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/a><\/p>\n<p>Use the new \u201cAdd AI Generated Commit Message\u201d sparkle pen icon in the Git Changes window to generate a suggestion. GitHub Copilot will look at the file changes in your commit, summarize them, and then describe each change. You can then &#8220;Insert AI Suggestion&#8221; or &#8220;Discard.&#8221;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion.png\"><img decoding=\"async\" class=\"alignnone wp-image-246148 \" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion-204x300.png\" alt=\"generated Git commits with GitHub Copilot suggestion\" width=\"360\" height=\"529\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion-204x300.png 204w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion-696x1024.png 696w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion-768x1129.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion-1045x1536.png 1045w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/11\/Generate-Commit-Message-Suggestion.png 1352w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/a><\/p>\n<h3>Let us know what you think<\/h3>\n<p>We hope this new feature makes writing your Git commit messages easier \u2013 leading to productivity for you, your teammates, and even \u201cfuture you\u201d when reviewing your changes and helping others understand your Git history. Share your thoughts with us, so we can continue to improve your experience.<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/AICommitMessages\" target=\"_blank\">Take the Survey<\/a><\/div><\/p>\n<p>We appreciate the time you\u2019ve spent reporting issues\/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio the best tool it can be! You can share feedback with us via\u202f<a href=\"https:\/\/developercommunity.visualstudio.com\/home%22%20\/t%20%22_blank\">Developer Community<\/a>: report any bugs or issues via\u202f<a href=\"https:\/\/learn.microsoft.com\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio?view=vs-2022\">report a problem<\/a>\u202fand\u202f<a href=\"https:\/\/developercommunity.microsoft.com\/VisualStudio\/suggest\">share your suggestions<\/a>\u202ffor new features or improvements to existing ones.<\/p>\n<p>Stay connected with the Visual Studio team by following us on <a href=\"https:\/\/www.youtube.com\/@visualstudio\">YouTube<\/a>, <a href=\"https:\/\/twitter.com\/VisualStudio\">Twitter<\/a>, <a href=\"https:\/\/www.linkedin.com\/showcase\/microsoft-visual-studio\/\">LinkedIn<\/a>, <a href=\"https:\/\/www.twitch.tv\/visualstudio\">Twitch<\/a> and on <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/?view=vs-2022\">Microsoft Learn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After spending hours on a bug fix or a feature update, often the last thing we developers want to do is carefully explain the contents of the Git commit. The latest Visual Studio preview is here to help. Use the new generated Git commit message feature to help you describe your set of changes. You [&hellip;]<\/p>\n","protected":false},"author":98326,"featured_media":246147,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[],"class_list":["post-246144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio"],"acf":[],"blog_post_summary":"<p>After spending hours on a bug fix or a feature update, often the last thing we developers want to do is carefully explain the contents of the Git commit. The latest Visual Studio preview is here to help. Use the new generated Git commit message feature to help you describe your set of changes. You [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/246144","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\/98326"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=246144"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/246144\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/246147"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=246144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=246144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=246144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}