{"id":237300,"date":"2022-04-13T08:30:13","date_gmt":"2022-04-13T15:30:13","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=237300"},"modified":"2022-05-09T12:43:27","modified_gmt":"2022-05-09T19:43:27","slug":"supercharge-your-git-experience-in-vs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/supercharge-your-git-experience-in-vs\/","title":{"rendered":"Supercharge your Git experience in VS"},"content":{"rendered":"<p>Have you experienced delays when viewing your Git repository or branch history in Visual Studio? Have you run a network command like force-push and had to wait for the operation to complete? Your Git repository may be having performance issues due to its large size. We are happy to integrate a relatively new Git feature called <a href=\"https:\/\/devblogs.microsoft.com\/devops\/supercharging-the-git-commit-graph\/\" target=\"_blank\" rel=\"noopener\">the commit graph<\/a> which <span class=\"cf0\">leads to improving the performance of your Git operations and significantly improving performance in Visual Studio.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/CommitGraph-s2.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-237303\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/CommitGraph-s2.gif\" alt=\"Commit Graph performance improvement\" width=\"1920\" height=\"1080\" \/><\/a><\/p>\n<p><div class=\"alert alert-primary\"><span class=\"cf0\">We&#8217;ve observed<strong> an average of 70% performance improvement in loading branch history in the Git repository window for a repository with 332k commits when enabling the commit graph in Visual Studio<\/strong><\/span>. Download the latest preview version of Visual Studio and utilize this feature.<\/div><\/p>\n<p><!--StartFragment --><\/p>\n<p><!--EndFragment --><\/p>\n<p style=\"text-align: center;\"><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/vs2022preview\" target=\"_blank\">Download Visual Studio 2022 Preview<\/a><\/div><\/p>\n<p>Once you are on the latest preview version of Visual Studio (17.2 Preview 3 or later), Visual Studio will automatically show the following notification where you can choose to enable the commit graph.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/Commit-Graph.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-237337\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/Commit-Graph.png\" alt=\"Commit Graph notification\" width=\"1024\" height=\"192\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/Commit-Graph.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/Commit-Graph-300x56.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2022\/03\/Commit-Graph-768x144.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Alternatively, you could manually enable the commit-graph by going to<strong> Git &gt; Settings &gt; Enable commit graph for better Git performance.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h3>What happens when you enable the commit graph?<\/h3>\n<p>When the commit graph is enabled, a commit graph file gets generated in your repository which then is used to quickly parse and sort your commits. The commit graph file also includes extra information to help avoid parsing commits. G<span class=\"cf0\">enerating the commit graph is a background operation that could take several seconds up to couple of minutes depending on the size of your repository. It is also a blocking Git operation that will block you from performing other Git operations in Visual Studio like Fetch or Pull. <\/span>View <a href=\"https:\/\/devblogs.microsoft.com\/devops\/updates-to-the-git-commit-graph-feature\/#what-is-the-commit-graph-and-what-is-it-good-for\">this blog<\/a> to read more about how the commit graph works.<\/p>\n<p>&nbsp;<\/p>\n<p><!--StartFragment --><\/p>\n<p><!--EndFragment --><\/p>\n<p><!--EndFragment --><\/p>\n<h3>When should you consider running the commit graph?<\/h3>\n<p>You will see most of the value of the commit graph right after you run it for the first time. Visual Studio will only show the commit graph notification when it is not enabled, and when Visual Studio predicts that running the commit graph could enhance performance.<\/p>\n<p>&nbsp;<\/p>\n<h3>How to manually run the commit graph<\/h3>\n<p>If you did not receive the notification, you can also choose to manually re-run the commit graph at any time if you have already enabled it in Visual Studio by using the following command line or by disabling and enabling the commit graph in our Git settings <strong>Git &gt; Settings &gt; Enable commit graph for better Git performance<\/strong>.<\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\"><code>git commit-graph write --reachable<\/code><\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Commit graph resources<\/h3>\n<p>If you are interested in learning more about the commit graph Git feature, you might find the following resources a good starting point:<\/p>\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/devops\/supercharging-the-git-commit-graph\/\">Supercharging the Git Commit Graph &#8211; Azure DevOps Blog (microsoft.com)<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/devops\/updates-to-the-git-commit-graph-feature\/\">Updates to the Git Commit Graph Feature &#8211; Azure DevOps Blog (microsoft.com)<\/a><\/li>\n<li><a href=\"https:\/\/git-scm.com\/docs\/commit-graph\">Git &#8211; commit-graph Documentation (git-scm.com)<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Let us know what you think<\/h3>\n<p>We have benefitted greatly from all the rich feedback we\u2019ve received from you \u2013 thank you! We hope you\u2019ll help us continue to improve by giving the new commit-graph feature a try and letting us know what you think by taking the following quick survey:<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/www.surveymonkey.com\/r\/WDPY9XM\" target=\"_blank\">Share Your Feedback<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you experienced delays when viewing your Git repository or branch history in Visual Studio? Have you run a network command like force-push and had to wait for the operation to complete? Your Git repository may be having performance issues due to its large size. We are happy to integrate a relatively new Git feature [&hellip;]<\/p>\n","protected":false},"author":4322,"featured_media":255385,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[1396,5,510,431,4381,6815],"class_list":["post-237300","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-azure-devops","tag-csharp","tag-cpp","tag-git","tag-github","tag-visual-studio-2022"],"acf":[],"blog_post_summary":"<p>Have you experienced delays when viewing your Git repository or branch history in Visual Studio? Have you run a network command like force-push and had to wait for the operation to complete? Your Git repository may be having performance issues due to its large size. We are happy to integrate a relatively new Git feature [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/237300","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\/4322"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=237300"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/237300\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/255385"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=237300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=237300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=237300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}