Announcing the Release of the Git Experience in Visual Studio

Pratik

We’re excited to announce that our new Git tooling is now the default source control experience in Visual Studio 2019, beginning with version 16.8. We’ve been working on this experience over the last year, iterating based on your feedback to build out key features, enhance performance, and fine tune quality. Above all, we’ve focused on improving discoverability for your common workflows and simplifying navigation to reduce context-switching. Regardless of whether you are part of a large team or working on a personal project, whether you are an experienced developer or just starting out, we strongly believe the new Git experience in Visual Studio 2019 will have something for you. Here’s seven reasons why we think you should try it out.

Git Productivity Demonstration in Visual Studio 2019 v16.8

Git Productivity in Visual Studio 2019

Redesigned Git repository creation

To get started with Git, Visual Studio lets you add your local code to Git and GitHub with a single click. The Create a Git repository dialog contains the new integrated GitHub sign-in flow, similar to what we offer for Microsoft accounts. Here, you can set the repository to be publicly visible or switch it to private. That makes it securely accessible to only you and any designated collaborators. In addition to GitHub, you can also push your code to an existing remote repository. This can be one you’ve already created on Azure DevOps or any other provider. And finally, you can choose to create a local-only Git repository if you are not ready to push to a remote host.

Image createrepodialog

Create Repository dialog

Accessible top level Git menu

You can now access your favorite Git features using the top level Git menu. It’s at easy reach through the Alt+G keyboard shortcut. This menu also has the Local Repositories submenu. By expanding it, you can easily switch between local Git repositories you have previously opened in Visual Studio.

Image 16 8 P3 reposlist

Git menu with Local Repositories list

View files in Solution Explorer

After you’ve opened or cloned a Git repository, Visual Studio helps you get straight to your code. Solution Explorer loads the root of the repository and scans the directory for any View files. Instead of having to search for your .sln file to open it, Visual Studio detects and loads the solution automatically. If your repository has more than one .sln file, then Solution Explorer shows you the list of available views to choose from. Subsequently, you can toggle between the currently open Solution (view) and the list of Views by using the Switch Views button in the Solution Explorer Toolbar.

Image 16 8 P2 listofviews

Switch Views in Solution Explorer

Streamlined inner loop Git Changes window

The new Git Changes window is designed to provide quick access to commonly used Git operations that you need while you are coding. You can create new branches, stash, stage, amend, and commit changes, all from the same place without switching pages or losing context. Moving to the top of the window, you’ll see handy fetch, pull, and push buttons. They allow you to sync commits and tags with your remotes (that’s right, multiple remotes!). The Git Changes window also has an indicator displaying the number of outgoing and incoming commits. This indicator functions as a link to take users to the Git Repository window. From there, you can view a summary of your outgoing and incoming commits before you sync.

Image gitchangeswindow

Staged Changes and Stashes in the Git Changes Window

Full screen Git Repository window

If you like browsing and managing your repository, you no longer need to leave Visual Studio. The new Git experience comes with a rich Git Repository window that makes it easy to visualize the entire history of your repository. You can right click on a branch to perform operations like merge, rebase, reset, and cherry pick. Moreover, the Repository window is accessible through the Git menu, the View menu, and the status bar.

Image GitRepoWindow

Branch History in the Git Repository Window

Enhanced merge conflict resolution

If you run into a merge conflict, Visual Studio now guides you through the process of resolving it. The Git Changes tool window clearly lists unmerged changes. Also, it displays a status message specifying that conflict resolution is in progress. Further, a gold info bar in the conflicting file prompts you to open the Merge Editor. Once you’re there, the three-way Merge Editor takes you through each conflict in the file. In other words, it allows you to compare lines and even individual word-level differences. Moreover, you can accept all current or incoming changes at the file level with a single click.

Image git merge editor

Merge Conflict Resolution with the Merge Editor

Customizable experience

We want you to be able to personalize your Git experience. To change any of your preferences at the repository level or the global level, go to Git – Settings in the menu bar. This will take you to the consolidated Tools – Options pane for Source Control.

Image Git Settings

Git Settings in Tools – Options dialog

However, if these features aren’t working out for you, it’s possible to revert back to the full Team Explorer experience. Go to Tools – Options – Environment – Preview Features and toggle the New Git user experience checkbox. Please let us know why!

Image git preview feature

New Git user experience Preview Feature flag

This is just the beginning

To summarize, from the new Git menu, you can clone, create, or open repositories. You can use the integrated Git tool windows to commit and push changes to your code, manage branches, sync your remote repositories, and resolve merge conflicts. Find the full list of capabilities in the Release Notes. Learn how to use the features in our documentation. Most importantly, join the conversation on Developer Community to weigh in on what we’re building next. And please provide feedback as we continue to enhance the Git experience in Visual Studio!

196 comments

Comments are closed. Login to edit/delete your existing comments

  • Falanga, Rod, DOH

    Pratik, I love the project management tools built into VS with TFS, so I can associate a check-in with a work item, either as associated or resolving the issue. Will this new Git Experience do the same thing?

    • Pratik NadagoudaMicrosoft employee

      Thanks for the feedback, Falanga. We agree this is important functionality. We are exploring a new design for this mechanism so that we can generalize it to work for both GitHub and Azure DevOps. We’d appreciate your feedback on how you’d like to see this, please vote and comment on the suggestion ticket. We will also post our designs there once they’re ready. In the meantime, as a workaround, the capability still exists, you can manually type the #number into the commit message, and the work item will get linked.

  • Markus Seidel

    I like the look and the usability of the new Git Experience, but I’m missing the possibility to add a workitem to a commit.
    Furthermore it would be nice, to be able to create a pull request from within Visual Studio.

    • Pratik NadagoudaMicrosoft employee

      Thank you for the feedback, Markus. Similar to what I mentioned above, please vote on the suggestion ticket so that we can prioritize the work sooner. In the meantime, you can add a work item to the commit by typing in the #number into the commit message. As long as you are connected to your remote, when you push, the work item will get linked.

      For Pull Requests, we are still figuring out what aspect of the PR process adds the most value integrated within VS. There is a suggestion ticket open already for creating PRs from within VS Git experience. But if you are suggesting some other aspect of it, please let us know so that we can create the appropriate suggestion on Developer Community.

  • Valentin Foley

    Nice new git features but why is the SYNC BUTTON gone. It was so easy to use pull and push at the same time.

    • Pratik NadagoudaMicrosoft employee

      Thanks for the feedback, Valentin. If you want to Sync when committing, then the Commit button has a dropdown that allows you to do that. We’ve also built in the mechanism to do a pull automatically if you try to push with unpulled commits. If you’re really missing a stand-alone Sync button, then please vote on this feature request to help us prioritize the work.

  • Aravind Raam

    Thank you for the updates to Visual Studio 2019. I am having a problem with it and am not sure if it is just me or if others have also reported it. After upgrading to 16.8.1 version this morning, I don’t see anything under Solution Explorer. I am able to clone the repo without any issues. The only items showing in the Team Explorer tab are the Azure DevOps Server, Project, and Git feature have moved groups. When I switch to Solution Explorer, it is totally empty and only the “Settings” icon is enabled.

    What could it be? Corrupt cache? Something else?

    • Pratik NadagoudaMicrosoft employee

      Hi Aravind, thanks for letting us know about this issue. We’re going to need to investigate with more details, because cloning a repo should populate Solution Explorer after the clone has completed. Could you please report a problem via the tool with the steps you took?

      In the meantime, try cloning through the menu, Git – Clone a repository, or open a repo through Git – Local Repositories. And see if that solves the issue.

      • Aravind Raam

        Thanks for the quick response. Just wanted to update that the workaround you had does work. When I connect to the repository (it is already cloned locally) using the Git->Clone Repository (choose Browse a Repository -> Azure DevOps), then it does show the solution and the files in the Solution Explorer. It just does not work if you do it via the Team Explorer (Connect and double click to choose the repo).

  • George Kravchenko

    Everything is now somewhere else, hidden, never to be found again. Worst update ever. Good luck figuring out how to switch repositories without reading this post, no one likes nested file menus. Good luck finding the sln you need in a sea of sll’s, how about respecting the folder structure? The full screen branches is dumb, why, the compact branches sidebar was so much better. The one good change, is merging, a lot easier now, good bye combobox drop down scrolling madness.

    • George Kravchenko

      OK, maybe second worst after you guys broke the Diff for 6 like months

    • Pratik NadagoudaMicrosoft employee

      Hi George, thanks for the feedback. Do let us know what you’re unable to find, we know that changing muscle memory is not the easiest thing. The good thing about adding commands to the menu system is that you can hit Ctrl+Q (global search) to locate any VS command so you don’t have to always remember where something is.

      For your solution, you can toggle the solution list in the Solution Explorer to get to the sln you need in your repo. If you have a lot, you can use the search bar in Solution Explorer to filter the list.

      The Git changes window also has a branch list dropdown that you can perform actions from, which is much simpler to access than the full screen Git Repository window. If there’s a feature missing there, please let us know by creating a feature request.

      And finally, I’m glad you like the new changes to the merge experience! Please do check out the top Git suggestions and continue to provide feedback on the changes you want to see.

  • Jose Hernandez

    if I access the Git Changes window and hit the “X” (close window) how do I get the Git Changes window back?

    • Pratik NadagoudaMicrosoft employee

      Hi Jose, good question. There are a few ways to get the window back:
      1. View menu -> Git Changes (Alt+V, G)
      2. Git menu -> Commit or stash.. (Alt+G, C)
      3. Global keybinding -> Ctrl+0, Ctrl+G
      4. Pencil icon in the Status Bar (Ctrl+Alt+F7)

      Whichever is the most convenient for you 🙂

  • kiti Azura

    Personally I love Azure Devops. I noted most git users don’t trust Visual Studio for git operations.

    It seems the still usable feature just got all the more complicated.

  • John V

    I like where you are going with these features, but in update 16.8.2 I had to disable the preview features because the changes window was acting very buggy, not updating after actions were taken.

    Maybe next release will be more solid.

    • Pratik NadagoudaMicrosoft employee

      Hi John, thanks for surfacing that feedback. Our team is jumping on any bugs that are being reported and patching them in servicing updates to 16.8. Could you please report the issue with repro steps so that we can investigate and fix it asap?

  • Joseph Burkey

    I’ve got to say this is absolutely horrible. I can’t start a project locally now and create a repo within DevOps all from within VS which is what I’ve done for years. As an organisation we’re not going to fork out for GitHub Enterprise to maintain private repos when DevOps already offers that so we’re just going to have to create empty repos first, clone them to the machines and then place the new solutions within the empty folder. Very farcical.

    As for the new ui, it’s ugly and having new windows pop up for branch management seems like a step back 10 years.

    • Pratik NadagoudaMicrosoft employee

      Thanks for the feedback, Joseph. We haven’t been able to prioritize this feature yet. But we’ve got our eye on it and monitoring the request through this suggestion ticket on Developer Community. Could you please add your vote to the ticket to help us prioritize this work? In the meantime, an easier way for you to execute this flow through Visual Studio is to create an empty new repository from Azure DevOps and paste the link of the newly created repo in the Existing Remote section of the Create a Git repository dialog box.

      This iteration is v1 of release and we’re not done yet. We’ll continue to work on adding and finetuning features based on customer feedback. Take a look at some of our top community suggestions to help us prioritize our upcoming roadmap.

  • Christian

    Hi! You are doing a great job with git experience!
    I know you are still working on this, but i have just a question. When I started using this experience, I tried to associated a work item and I used # (like github) and it worked perfect! But then i figured out that i coudn’t find work items from other projects. The old experiencie allowed that.. Will the new experience support to associate work items from another projects?

    • Pratik NadagoudaMicrosoft employee

      Hi Christian, thanks for the feedback! Yes we’re monitoring that request here. Please vote it up to receive updates as we prioritize this feature area.