Improved Git Experience in Visual Studio 2019

Pratik Nadagouda

Last week we released version 16.6 Preview 2 of Visual Studio 2019. It contained the first iteration of a revamped Git experience to improve your productivity when working with code on GitHub, Azure Repos, and other hosting services. You can learn more about how to use the entire Git feature set in Visual Studio in our new documentation.

You can enable or disable the experience by searching (Ctrl+Q) for preview features. In the Options window, just toggle the checkbox for the New Git user experience. We acknowledge that the functionality is still incomplete, with more enhancements coming soon. But we do expect this to be the default experience in the future. So in the meantime, we’re depending on you, the community, to let us know what we should prioritize in order to build what you need.

Turn on new Git UX preview feature

Turning on the new Git user experience in Preview Features

Initialize and Push

You can now initialize a local Git repository and push it directly to GitHub, Azure Repos, or other remote hosting services (e.g. BitBucket, custom Git servers, etc.) with a single click. If you have an existing project online, you can use the built-in GitHub and Azure Repos browsing experiences to clone your code.

Initialize and push a repository to GitHub

Initializing and pushing a repository to GitHub

Create new branches

Once your repository is initialized, we want to enable you to focus on your daily development workflows without having to leave your code. You can create branches and commit code changes from the new Git menu and the Git tool window.

Create a branch and commit changes

Creating a branch and committing changes

Manage branches

Context switching between tools and applications can be a pain. So we’ve added the ability to manage your branches from within the Git tool window. After working on your new feature or bug fix, use the branch dropdown in the Git tool window to check out, merge, rebase, view history, rename, and delete your branches.

Merging and deleting a branch

Merging a branch and deleting it

Resolve merge conflicts

We understand collaborating with your team and sharing your work is very important, especially so in the current climate with increased remote work. When it comes to keeping your code up to date, this can be done easily using the fetch, pull, and push shortcuts in the Git tool window. But even when you do your best to stay in sync with the latest code changes, running into merge conflicts is sometimes inevitable. With the improved experience, we’ve started to make it easier to navigate through and resolve your merge conflicts.

Resolve a merge conflict

Resolving a merge conflict

Please Share Your Feedback

This is just the beginning of a new first-class Git and GitHub experience in Visual Studio. Please add or vote for suggestions on the most important functionality that you want us to build or change.

Also be sure to keep these reference images handy for a quick overview of the new Git interface.

Image Git Tool Window Image Git Menu

And finally – stay safe, stay healthy.