{"id":229814,"date":"2020-07-09T07:00:32","date_gmt":"2020-07-09T14:00:32","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=229814"},"modified":"2020-11-17T14:11:19","modified_gmt":"2020-11-17T22:11:19","slug":"exciting-new-updates-to-the-git-experience-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/exciting-new-updates-to-the-git-experience-in-visual-studio\/","title":{"rendered":"Exciting new updates to the Git experience in Visual Studio"},"content":{"rendered":"<p><span style=\"font-size: 12pt;\"><strong>Update <\/strong>Nov. 17, 2020: <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/announcing-the-release-of-the-git-experience-in-visual-studio\/\">Integrated Git experience released<\/a><\/span><\/p>\n<p><span style=\"font-size: 12pt;\">We\u2019ve seen a lot of enthusiasm in the past few months with the improvements we&#8217;ve been making to the Git integration for Visual Studio 2019. You can learn more about how to use the entire feature set in our new <a href=\"https:\/\/aka.ms\/vsgitdocs\">documentation<\/a>. We\u2019ve also received a healthy amount of good feedback that\u2019s helped us focus our efforts. We first announced the new changes in a <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/improved-git-experience-in-visual-studio-2019\/\">blog post<\/a> in March. Since then, the team has been hard at work analyzing the feedback, polishing the user interface, and building more features. We\u2019re excited to share those updates with you today.<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">If you haven\u2019t tried the new Git user experience in Visual Studio yet, download the <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\" rel=\"noopener noreferrer\">latest Preview<\/a>\u00a0and you\u2019ll get the newest updates to the experience by default. If you\u2019re using the <a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\" target=\"_blank\" rel=\"noopener noreferrer\">public Release<\/a> of Visual Studio (version 16.6+), then hit Ctrl+Q to search and type in \u2018New Git user experience\u2019 to turn it on from the <em>Preview Features<\/em> pane of <em>Tools &#8211; Options<\/em>.<\/span><\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-229812 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/PreviewFeaturesGit.png\" alt=\"Image Tools Options Preview Features\" width=\"748\" height=\"144\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/PreviewFeaturesGit.png 748w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/PreviewFeaturesGit-300x58.png 300w\" sizes=\"(max-width: 748px) 100vw, 748px\" \/><\/p>\n<p style=\"text-align: center;\"><em>New Git user experience Preview Feature flag<\/em><\/p>\n<p><span style=\"font-size: 12pt;\">You can turn the experience off using the same checkbox.<\/span><\/p>\n<h3><\/h3>\n<h3>Merge Conflict Resolution improvements<\/h3>\n<p><span style=\"font-size: 12pt;\">As we talked to customers about the pain points they face when working with source control, we consistently heard about the frustration with merge conflicts. When you get a merge conflict, it interrupts your coding flow and forces you to switch context. We also realized we needed better messaging to indicate you encountered a conflict during a Git pull operation. To address these concerns, the <em>Git Changes<\/em> tool window now clearly lists unmerged changes and displays a status message specifying that conflict resolution is in progress.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-229816 size-medium\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-Git-Changes-window-with-unmerged-changes-1-231x300.png\" alt=\"Image image of Git Changes window with unmerged changes\" width=\"231\" height=\"300\" data-wp-editing=\"1\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-Git-Changes-window-with-unmerged-changes-1-231x300.png 231w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-Git-Changes-window-with-unmerged-changes-1.png 719w\" sizes=\"(max-width: 231px) 100vw, 231px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Merge in progress with conflicts (unmerged changes)<\/em><\/p>\n<p><span style=\"font-size: 12pt;\">In addition, in our user studies, as we walked through different workflows, we noticed that not all developers always have the <em>Git Changes<\/em> window open. If you don\u2019t, you&#8217;ll only see the file with conflict indicators and may try to manually resolve the conflicts in-line. We all know how painful that can be, especially for large files with many conflicts. So, we added a gold info bar at the document level to notify you when the file contains conflicts, prompting you to open the <em>Merge Editor<\/em>.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229808\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar.png\" alt=\"Image image of merge editor gold info bar\" width=\"2454\" height=\"558\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar.png 2454w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar-300x68.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar-1024x233.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar-768x175.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar-1536x349.png 1536w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/image-of-merge-editor-gold-info-bar-2048x466.png 2048w\" sizes=\"(max-width: 2454px) 100vw, 2454px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Gold info bar with link to open merge editor<\/em><\/p>\n<p><span style=\"font-size: 12pt;\">The three-way <em>Merge Editor<\/em> has undergone quite a revamp based on ongoing customer feedback. We\u2019ve changed the legacy TFVC terminology of <em>Source <\/em>and <em>Target <\/em>to <em>Incoming <\/em>and <em>Current<\/em> with a strong emphasis on the branch name. This used to be a constant point of confusion. <em>Incoming<\/em> and <em>Current<\/em> also each have a new checkbox to take all changes from either version with a single click.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229986\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names.png\" alt=\"Image Merge Editor Names\" width=\"2467\" height=\"357\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names.png 2467w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names-300x43.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names-1024x148.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names-768x111.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names-1536x222.png 1536w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Merge-Editor-Names-2048x296.png 2048w\" sizes=\"(max-width: 2467px) 100vw, 2467px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Incoming \/ Current and branch names in the Merge Editor headings<\/em><\/p>\n<p><span style=\"font-size: 12pt;\">The <em>Merge Editor<\/em> now makes it easier to parse conflicts by better aligning matching lines, displaying word level differences, and making differing whitespace visible. We\u2019ve also reduced the clutter around the zoom margin, health margin, and toolbar. Further, you can turn off non-conflicting differences to just focus on the conflicts. And if you don&#8217;t need the horsepower of the <em>Merge Editor<\/em>, such as in Add\/Add conflicts, you can resolve those now at the file level with a two-way merge.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229803\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/gif-of-merge-editor.gif\" alt=\"Image gif of merge editor\" width=\"3240\" height=\"2100\" \/><\/p>\n<p style=\"text-align: center;\"><em>Merge editor experience<\/em><\/p>\n<h3><\/h3>\n<h3>Brand NEW Git Repository window<\/h3>\n<p><span style=\"font-size: 12pt;\">After we launched the first version of the <em>Git Changes<\/em> tool window, we wanted to make sure we incorporated community feedback and suggestions as we iterated on the experience.\u00a0Our research informed us there are specific Git operations most of you perform while coding that made sense in the <em>Git Changes<\/em> window adjacent to your editor. But other times, you need a full-screen experience to focus on a dedicated Git activity. So, in <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/releases\/2019\/release-notes-preview#git-productivity\">Version 16.7 Preview 3<\/a>, we built the <em>Git Repository <\/em>window, the future home for all your Git related activities. It&#8217;s now available in Visual Studio Preview, with some initial functionality.<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">First, we built an interactive branch tree where you can manage all the branches in the repository in a single view. From here you can use the context menu to <em>Fetch<\/em>, <em>Pull<\/em>, and <em>Push<\/em> branches without having to check them out. You can also create a new branch directly from any local or remote branch. We&#8217;ve also added the commands to <em>Reset<\/em>, <em>Cherry-Pick<\/em>, and <em>Unset Upstream Branch<\/em>, which weren&#8217;t available in the <em>Git Changes<\/em> branch picker.<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">In addition to using the power-packed context menu, you can also double click a branch in the list to show you its history in the right pane. At the top of the graph, you can see incoming commits after performing <em>Fetch<\/em>. Soon, you\u2019ll be able to see outgoing commits as well.\u00a0Double clicking on a commit will open its metadata in the\u00a0<em>Commit Details<\/em>\u00a0pane. You can access this window through the<em> Manage Branches<\/em> command in the <em>Git<\/em> menu as well as the <em>Unpushed Commits<\/em> button in the <em>Status Bar<\/em>.\u00a0<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">This is just the first iteration of the <em>Git Repository<\/em> window and we will continue to build more features into it. But in the meantime, we\u2019re eager for you all to try it out and let us know what you think.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229974\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Git-Repo-window.gif\" alt=\"Image Git Repo window\" width=\"2048\" height=\"1327\" \/><\/p>\n<p style=\"text-align: center;\"><em>Manage branches and view history from the Git Repository window<\/em><\/p>\n<h3><\/h3>\n<h3>Additional updates<\/h3>\n<h5>Create a repository<\/h5>\n<p><span style=\"font-size: 12pt;\">You can now create a new repository on GitHub, Azure Repos, or any remote URL at any time, even from an empty folder. Visual Studio will help you initialize the new repository locally as well as push it to your remote GitHub account. Use the <em>existing remote<\/em> option to push your code to a hosted Git repository you&#8217;ve already created.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229975\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Create-a-new-repo.gif\" alt=\"Image Create a new repo\" width=\"2048\" height=\"1327\" \/><\/p>\n<p style=\"text-align: center;\"><em>Create a new repository and push it to GitHub<\/em><\/p>\n<h5><\/h5>\n<h5>Git Settings<\/h5>\n<p><span style=\"font-size: 12pt;\">It\u2019s super important to be able to personalize and customize your Git settings at a repository level as well as at a global level. We\u2019ve migrated all your settings to <em>Tools &#8211; Options &#8211; Source Control.<\/em><\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-229810 size-large\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Image-of-settings-pane-1024x697.png\" alt=\"Image Image of settings pane\" width=\"640\" height=\"436\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Image-of-settings-pane-1024x697.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Image-of-settings-pane-300x204.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Image-of-settings-pane-768x523.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Image-of-settings-pane-1536x1045.png 1536w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Image-of-settings-pane.png 1646w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Git settings<\/em><\/p>\n<h5><\/h5>\n<h5>Streamlined Push<\/h5>\n<p><span style=\"font-size: 12pt;\">Along the lines of better error management, we&#8217;ve enhanced the Push experience so that if you <em>Push<\/em> changes before pulling upstream changes, you get options to <em>Force Push<\/em> or <em>Pull and Push<\/em>. To <em>Force Push<\/em>, you first need to enable &#8216;push &#8211;force&#8217; in your Git settings.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229977\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Streamlined-Push-dialog.gif\" alt=\"Image Streamlined Push dialog\" width=\"2048\" height=\"1327\" \/><\/p>\n<p style=\"text-align: center;\"><em>Dialog to help with Pushing commits<\/em><\/p>\n<h5><\/h5>\n<h5>Git Changes window<\/h5>\n<p><span style=\"font-size: 12pt;\">We\u2019ve been improving the new <em>Git Changes<\/em> window that we first introduced in Version 16.6. We enhanced the branch picker by adding special icons to more easily differentiate between remote branches, local branches tracking a remote, and local branches not tracking a remote.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-229806\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Git-Changes-Ref-Picker.png\" alt=\"Image Git Changes Ref Picker\" width=\"500\" height=\"301\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Git-Changes-Ref-Picker.png 988w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Git-Changes-Ref-Picker-300x180.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Git-Changes-Ref-Picker-768x462.png 768w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Branch Picker in Git Changes window<\/em><\/p>\n<h5><\/h5>\n<h5>Work Items<\/h5>\n<p><span style=\"font-size: 12pt;\">And finally, when the new Git experience is enabled, work items and builds can still be accessed from <em>Team Explorer.<\/em><\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-229813\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Work-items-in-Team-Explorer.png\" alt=\"Image Work items in Team Explorer\" width=\"364\" height=\"426\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Work-items-in-Team-Explorer.png 364w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2020\/07\/Work-items-in-Team-Explorer-256x300.png 256w\" sizes=\"(max-width: 364px) 100vw, 364px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Team Explorer Home page with Work Items and Builds<\/em><\/p>\n<h3><\/h3>\n<h3>Wrapping up<\/h3>\n<p><span style=\"font-size: 12pt;\">As you can hopefully tell, we\u2019ve been spending a bit of time to improve this experience. We see that remote work and collaboration are becoming more important than ever. And that\u2019s why we continue to invest in these areas. Let us know in the comments what you think and what you\u2019d additionally like to see here. We track all our customer asks in <a href=\"https:\/\/aka.ms\/vs-suggest\">Suggestion Tickets on the Developer Community<\/a> portal. Even though we sometimes don&#8217;t get to all of them immediately, we really appreciate the suggestions you make. And we do enjoy engaging in design conversations on the portal. Thank you for the ongoing feedback; you keep us honest and make us better.<\/span><\/p>\n<p><span style=\"font-size: 12pt;\">Stay safe. Stay healthy.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve been addressing your feedback for improving the Git experience within Visual Studio. This post talks about updates in merge conflict resolution, branch management, previewing commits, branch history, and much more.<\/p>\n","protected":false},"author":3029,"featured_media":229816,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[431],"class_list":["post-229814","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-git"],"acf":[],"blog_post_summary":"<p>We&#8217;ve been addressing your feedback for improving the Git experience within Visual Studio. This post talks about updates in merge conflict resolution, branch management, previewing commits, branch history, and much more.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/229814","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\/3029"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=229814"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/229814\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/229816"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=229814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=229814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=229814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}