Improved Git Experience in Visual Studio 2019
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.
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.
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.
Creating a branch and committing changes
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 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.
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.
And finally – stay safe, stay healthy.
In my case I frequently repeat such steps:
2. Find branch remote/master or remote/develop
3. Merge from
2. Find branch remote/master or remote/develop
3. New branch from
4. Create branch
Could you make it requiring less steps. Some suggestions:
1. Mark branches as favorite so I don’t have to search for remote/master or remote/develop as they are always on top.
2. Eliminate second merge click
3. Eliminate fetch click for remote branches (do it automatically)
These are great suggestions! We’ll track them but feel free to create a request at https://aka.ms/vsfeedback so that others can vote and bring visibility to these features.
Please please please rename ‘Source’ and ‘Target’ when resolving a merge conflict to something more meaningful. I never know which is which.
Yup yup, it is very confusing, and we’re working on that!
Given that there’s always going to be gaps in the GUI commands, e,g, sub-modules, there needs to be a quick way to bring up the command prompt.
I use Actions=>Open Command Prompt in the old implementation all the time.
We understand that sentiment. There are a ton of CLI commands and it will take some time to implement even the most popular ones. We’re going to be adding an entry in the Git menu to open the command prompt soon!
As you are improving the link between VS & AzDO, is there any chance of a quick fix for this feedback item?
Basically, the URL used to clone an AzDO git repo if you start from VS isn’t the same as if you start from the AzDO website. The website one includes some extra info that helps the git credential manager pick the right auth mechanism. Without it, LFS gets stuck in a loop asking for credentials.
Hey James – I dug into the feedback ticket and made sure it’s on our backlog. Unfortunately, we’re not going to get to it in this release, but possible for a future release! Until then, there are some workarounds suggested on a related ticket here – https://developercommunity.visualstudio.com/content/problem/728099/clone-git-lfs-repo-in-visual-studio-does-not-work.html
Support “Git Flow” ( There is an app “Smartgit” that supports Git Flow ) and multiple origins and a good visual representation of branches
Thanks! We’re tracking requests for Git Flow support here – https://developercommunity.visualstudio.com/idea/385973/support-for-git-flow.html
And we’re working on designing a visual branch history graph right now!
Is there any chance of getting the terminology used with rebase operations clearer?
Everyone I know (including myself) instinctively think that it’s back to front.
“Are you sure you want to rebase YourCurrentBranch onto master” – is instinctively read as “you’re going to modify master”, when it’s actually the other way round.
I know this is likely to be a bone of contention for people steeped in Git, but couldn’t it just say “Are you sure you want apply the latest changes in the master branch onto YourCurrentBranch”?
Yep I completely understand, and this isn’t the first time we’re hearing about the confusion in the wording. However, it is industry standard wording and so we do want to stay aligned with what everyone is at least used to seeing. I do see the value of a confirmation dialog that explains what is actually going to happen. I’ll look into it, thanks!
So when are you going to finally let us stage lines? Sometimes we want to break a change into finer details. Why I am a contributor to and use Git Extensions. Frankly your TFS view of git operations stinks.
I believe the feature you’re suggesting is captured in this ticket – https://developercommunity.visualstudio.com/idea/443834/git-stage-selected-portion-of-file.html. As we revamp the experience, we’re tracking the open the suggestion tickets and planning to integrate some of the top ones into the new experience. So please add your vote!
I am missing this feature a lot. When I need to stage lines, I am always forced to use another tool, unfortunately.
First of all, thank you so much for this! I’ve always found the Team Explorer setup for git to be so poorly designed for git as everything took twice as many clicks as was necessary (or in any other git ui).
Just downloaded the preview version to check it out and have some thoughts. Apologies if any of this is being planned!
Any reason why the main branch dropdown doesn’t show a tab remote branches? Looks like you have to create a new branch, then go to remote, then select the branch you want to pull down. Seems like having a remote branch tab in the initial branch dropdown where you could select a remote branch and have it automatically down and switch to it would be more efficient. Plus, in regards to the branch dropdown, right clicking on the branch in the branch selection dropdown should also bring up the menu for that branch so you don’t have to explicitly click on the chevron.
More minor complaint since it’s just a visual thing, I’m not sure I’m a big fan of the top panel where it shows the branch, status message, and the fetch/pull/push buttons. Mostly I’m not a big fan of the vertically aligned buttons. I think having the status message line taking up the full width of the sidebar so the branch and the buttons could be on the same vertical alignment would look a bit better, personally.
All in all, though, I’m a huge fan of these changes! Great to see this going in a much better direction than the Team Explorer.
Glad to hear that you’re a fan!
Remote branches is coming soon in an update, so stay tuned – https://developercommunity.visualstudio.com/content/problem/967206/git-window-does-not-display-remote-branches-in-bra.html
And we’re also working on design modifications to the top git status section that may be more to your liking based on your comments. 🙂
Thanks for the feedback, and keep it coming!
Where is ‘Push Branch’?
It’s the up arrow next to branch name and the command is also in the Git menu.
Will it be possible to use the features with T4 templates and DTE ExecuteCommand? For example so that the newly created files can be added to source control automatically? Something like command File.AddtoasourceControl but that actually works…
Hey Roman – as of now, we don’t have extensibility for these features and don’t support DTE.ExecuteCommand. If that’s an important feature request for your scenarios, could you please create a suggestion? https://aka.ms/vsfeedback Thanks!
I really wish you’d implement a proper “git mv” for renaming. Renaming and changing files in VS in one go always breaks history.
I have to work around it by using the Shell, which defeats the purpose of having it integrated.
It’s already posted as a request, but it doesn’t seem like you understand why.
Agree! This is an issue I run across frequently, especially early on in dev cycles where things are coming into the tree quickly and getting renamed/moved frequently, maintaining that history is critical, especially when the original dev is no longer available
Hey Lasse – I hear you. Although have you tried staging the renamed files before committing? With that workaround, if you stage the added (new filename) and the deleted (old filename), Git’s rename detection will run, and VS will display it as a rename. In this scenario, no history is lost. Can you try if that works for you?
For general reference, if it’s still a problem, here is the post on Developer Community – https://developercommunity.visualstudio.com/idea/731084/add-team-explorer-git-mv-support-to-moverename-fil.html. Please vote!
It is missing basic feature of checking out a remote branch. Apparently, new Git UI does not have any way to do it and old Team Explorer has lost all branch management features.
Completely agree – this is a very limited feature until it gives me the ability to checkout a remote branch. Suggest that Microsoft expedite the release of this feature.
So, you can, but it’s an annoying process. First, make sure you fetch to pull in remotes, otherwise you’ll have to back out and do that! But click on the dropdown at the top to select a branch, then hit the button for New Branch. Click on the Parent Branch option, and there will be an option for remotes. Once you do that, it’ll default to the name of the remote branch. If you don’t see your branch there, then you’ll need to close the popup and fetch.
Yes that’s an issue that we’re tracking (https://developercommunity.visualstudio.com/content/problem/967206/git-window-does-not-display-remote-branches-in-bra.html) and the feature will be coming soon in the next Preview update. Thanks for the feedback!
If there are any other features that you’re missing and don’t see in Team Explorer, you can get those back by toggling the Preview Feature off. And do let us know what it is, so we can look into it.
I can no longer find the Git tags windows. We use that to Tag for a release.
Yes that’s something we haven’t implemented in the new experience yet. It’s on our roadmap!
Are there any plans to add support for partial commits, eg one can select a part of a modified file to include in a commit? Thanks
This would be a great feature, I subscribe to the theory that many smaller commits are much better than one mega commit and sometimes end up having to commit way more than I normally would because you need to break the commits up in such a way that you don’t break the build pipelines and because it’s all of nothing you typically end up committing multiple entire files that may not necessarily be related changes.
We’re tracking this suggestion – https://developercommunity.visualstudio.com/idea/443834/git-stage-selected-portion-of-file.html. Please vote on it as that would help us correctly prioritize its importance. And thanks for the continued feedback!
Can we get better option to compare our changes?
Take a look at how it’s done in Github Desktop – you can go through all files with just up/down arrow meanwhile in VS I have to right click on every file and then choose compare with older version (I assume it’s the same as TFSVC)
it’s annoying experience. I wish VS was like Github Desktop – simple with strong focus on code instead of clicking all around
That’s a good point. We’re working on a full screen focused experience that will show diff previews in a single click. That’s on the roadmap but a little ways away. In the meantime, with the new Git tool window, we give you the option to choose. You can click the three dots next to the Changes header and set Compare File as Default Action. That should reduce the amount of clicking that you have to do. Just arrow up/down the files list and hit enter to see the diffs.
Is there functionality for previewing a commit? Or a pull request?
I generally use the gitextensions dialog to be able to see/review all changes at once.
Or the pull request view in Azure Devops to see/review all the changes at once.
It would actually be really nice to have a “preview” mode where changing the focus on the changed file would open the diff for viewing.
E.g. four files changed
Hit down arrow four times to scroll through and see all the diffs.
No not yet. We do have a Pull Request extension on the marketplace – https://marketplace.visualstudio.com/items?itemName=VSIDEVersionControlMSFT.pr4vs but we haven’t updated it in a while as we’re planning on integrating those features in VS on our roadmap.
For previewing commits, you can right click the changed files to compare with the unmodified version. But please add your ‘preview’ mode suggestion to Developer Community – https://aka.ms/vsfeedback. Thanks!
I don’t like that now the functionality is spread over two places.
I think that is solved in a good way in the current implementation already, as everything can be done in the Team Explorer.
It also looks like the git status in the bottom bar is missing, where you quickly can switch branch or go to changes or sync even when Team Explorer is not opened.
Also for me as a developer that uses both git and TFVC I like the similarities that the Team Explorer has when used with one or the other.
Also what happens with plugins that integrate into the Team Explorer?
I used to checkout a branch, then on the Team Explorer Home tab I saw all the solutions in that branch.
Where do I now go to see those solutions?
If that new Create Branch dialog could have work item selection too, and default in a name based off it! That would be the best feature ever for me!
A few thoughts…
I frequently stage a bunch of local commits and push them out at the same time, where do I see my locally staged commits now? They used to be visible on the Sync tab.
I also use submodules frequently and have to use Git Extensions for the task. Will proper submodule support be built into this new experience? There is a long standing feedback request for this and awhile back it was updated saying that the feature would be worked on, but nothing since.
Thanks for the feedback Adam. We’re building out the functionality, starting with the most commonly used features from Team Explorer and then brand new features. Please vote for and follow the suggestions in Developer Community. (https://developercommunity.visualstudio.com/idea/351549/full-git-submodule-support.html) That’s what we’ll update as we start working on new functionality. If an item is on our roadmap then we may not get to it immediately but it is on our radar.
We’ll also continue to add more details to the roadmap here – https://docs.microsoft.com/en-us/visualstudio/productinfo/vs-roadmap
So this is going to be yet another partial implementation of a feature with vague promises of maybe possibly adding requested features at some undefined future date IF enough of us have no actually work to do and can spend our time surfing feature requests/bug reports to vote up so someone on the team might think them worth doing?
Your blog and each of the posts take a long time to load if you are logged-in.
Thanks for the feedback. Yes, we are aware of this issue and have been chipping away at this problem for the past few months. While we do see improvements in our reports we know there is a lot of room for improvement still. We are working on some additional changes coming soon that should further improve page load times when signed in.
Feel free to join the discussion of this here, Dean:
Reported nearly a full year ago and it still hasn’t been fixed. 🤷♂️
Suddenly I hit to this new git feature. Now, I cannot add work items from azure devops anymore. The most left button (button right of visual studio for Git) doesn’t work anymore. I am tryying to revert and use the old git
For my client’s private repository I see these menu items (I really need) disabled: ‘merge from’ and ‘rebase onto’ in Microsoft Visual Studio Community 2019 Preview (2) Version 16.6.0 Preview 2.1
Why? How to get them enabled?
You could possibly be running into an issue we’ve seen – You need to have the branch you want to merge into checked out. And then select the other branch you want to merge from. If you try to merge from the checked out branch, then the options will be disabled. Let me know if that doesn’t solve your problem.
I realize the wording is a little confusing, and we’re clarifying it in the next update –
“Merge into current branch”
“Rebase current branch onto”
We need better compare options, to review our changes
Take a look at github desktop – it increases productivity because instead of having to use compare on every single file, it lets us use arrows!
Thanks for the feedback! It would be awesome if you could vote on this suggestion for the same issue – https://developercommunity.visualstudio.com/idea/846823/compare-multiple-files-with-previous-version.html. Voting helps us prioritize!
Generally I like Git in Visual Studio, but there are things that can be smoothed out. The process is optimized for the user being offline most of the time. It should instead be optimized for the normal case, when users are online.
Problems: 1. You work on a branch and someone else makes a commit. You do not get the commit until you manually initiate a fetch or sync, leading to conflicts. 2. You switch branches and forget to fetch. Again conflicts result later. 3. You try to switch to a remote branch but it’s not listed.
Instead the system should automatically fetch everything so that the system’s understanding of all remote branches is always up to date. When new commits come in to the current branch, or when switching branches to a branch that is not up to date, the user should be alerted.
Thanks for that feedback! We’re considering indicators that will tell you if you have pending incoming or outgoing commits to be up to date – https://developercommunity.visualstudio.com/content/idea/716126/it-would-be-nice-if-git-branches-had-badges-indica.html Please let us know in the comments or by voting if this solution would work for you?
I miss the ability to tell if commits and see what commits need to be pushed. This was not the case with the Sync dialog.
Thanks for calling that out! There’s a suggestion open tracking that issue – https://developercommunity.visualstudio.com/content/idea/975504/display-all-commits-not-yet-pushed-to-remote-branc.html. Please vote and follow to get updates as we continue to add functionality.
What’s the plan with Azure DevOps integrations then? This looks like it’s trying to split Git operations away from all the work item management, pull requests, etc., which is a big step backwards. What’s the endgame here, and who is the intended audience for this?
Hey Gavin – ADO is still definitely part of the plan. Those features will continue to function within Team Explorer until we extend support for them from the new Git UX. Pull requests and work items are on our roadmap, along with GitHub Issues. We were lacking in GitHub functionality and so our first step is to bring it on par with our ADO features. The intent is to improve productivity for developers using Git on any hosted service.
Can’t say I like it. Looks a bit like VS Code and other than doing diffs, the VS Code interface is suboptimal.
It made me nostalgic for Team Explorer interface.
I do like some of the git-specifics. Highlighting the commit message box with different coloured text is nice.
The team missed IMO key MVP functionality of checking out from a Remote branch. I wouldn’t have released this git window without remote branches.
I did a revert to a previous commit, I was expecting to commit manually – the reversion also committed automatically – I felt there wasn’t enough feedback to the user, I accidentally reverted twice.
This isn’t just this release, but if you have a failure fetching, Visual studio says to look at the output window, but it is the output window says the same and nothing more and there was no additional info. (errors might have been a failure to authenticate or an error verifying the local certificate issuer). Might be an opportunity to address it.
Geez, really not a fan of the new experience related to git. Feels less intuitive and clumsier to use. I tend to jump on previews as I enjoying early access to new features. I didn’t enjoy this and found it hurt my productivity. After using it for a day I went and turned off the preview feature. First time I ever did that.
Hey Jeff – would appreciate hearing which features (or lack thereof) specifically hurt your productivity. Feel free to let me know here or file feedback directly https://aka.ms/vsfeedback
Yeah… well I tried it and hated it.
Common tasks were previously easy: -> Manage Branches, list of branches, checkout/merge etc was simple in the old view. The “sync” option has disappeared
I’ve turned it off. Please don’t remove the old version, this isn’t an improvement
Firstly thank you very much for your work.
I’m missing an Incomming Commits view when I call Fetch, before Pull. It was practical, but now I could not find this option at all.
You’re welcome! Glad to hear that feedback, the team is working really hard to get these features out in the right way. The ability to view incoming/outgoing commits is a feature we’ve heard as super useful and we’re working on a design for it. Could you add your voice to this suggestion here please? – https://developercommunity.visualstudio.com/content/idea/975504/display-all-commits-not-yet-pushed-to-remote-branc.html
Will Visual Studio Git support ever cope with nested Git repos on the filesystem?
This kind of thing:
Yes we do want to support it but haven’t gotten to it yet. We have the multi-repo experience on our roadmap – https://developercommunity.visualstudio.com/content/idea/351156/allow-multiple-git-repositories-to-be-active-at-on.html
But based on your image, I’m not sure if you mean fully nested repos or actual Git submodules. We’re tracking the submodule support separately – https://developercommunity.visualstudio.com/content/idea/351549/full-git-submodule-support.html
I don’t mean submodules. I’m talking about a source tree that is made up from multiple Git repos but they have to be nested because of the way the build system expects them to be laid out on disk.
One little remark: The color of the commit message placeholder text (“Enter a commit message (required) or stash message (optional).”) changed to orange in the dark theme. Maybe I can get used to it but it is currently quite distracting.
The previous light gray color was better suited as a placeholder text that should not grab any attention unless viewed at directly.
We’ve just fixed the font color there. It will come to an update soon! Thanks for calling it out 🙂
Great! Thank you for taking care of that 🙂
Even though it is an underrated feature, any plans to support Git Rerere (Reuse Recorded Resolution)?
So there are no plans as of now. But please submit a feature suggestion at https://aka.ms/vsfeedback! You never know, there might be more folks who want support for it, and voting will definitely help us prioritize it. 🙂
Hi, how can I completely disable GIT extension. It consumes too much CPU, mainly when checking on background. There are several issues open (like this: https://developercommunity.visualstudio.com/content/problem/586075/visual-studio-2019-its-impossible-to-turn-off-the.html) and none solved.
Thanks for bringing that up. It’s on our radar to fix!
I was hoping this new Git window will land at 16.6, but unless I’m missing something, I don’t see it. When can we expect to see it in GA releases?
Hi Tsahi – Nope you’re not missing anything. That was the original plan, but there was a lot to build so we made the call that the feature set was not GA ready for 16.6. We’re working on adding functionality and polishing some rough edges to make it a more complete experience based on customer feedback. And the updated plan is to release as a feature flag toggle in 16.7 GA. Stay tuned!
My short feedback:
– I miss the branch overview (-> “Manage branches”)
It was easy to find
It shows all branches easily
It shows me which branch was already pushed or pruned
One great feature I would love is: adding at the end of the cursor’s line information about the latest commit that affected it. VSCode’s GitLens add-on has this and it’s amazing.
Please, please, please add a way to turn off Git in VS. It’s 100% the source of the slowdowns and crashes that I have. I don’t understand why it’s such a difficult thing to do?
Yep yep yep we’re working on that. It’s trickier than it sounds because of all different ways that source control gets activated within Visual Studio. You can add your voice here – https://developercommunity.visualstudio.com/content/problem/586075/visual-studio-2019-its-impossible-to-turn-off-the.html
In previous version I could see my outgoing commits (commits that not pushed to remote) changes when I click “Sync” tab. I can only see three arrows to fetch/pull/push in new experience. How to view outgoing commits?
We’ve not implemented that functionality yet in the new experience. It’s on our backlog though! Please add your vote here – https://developercommunity.visualstudio.com/content/idea/975504/display-all-commits-not-yet-pushed-to-remote-branc.html
I really miss viewing a list of outgoing /incoming commits, and also the branch list. The current branch list being only available in a dropdown format is really depressing.
The branches in the dropdown also do not show which are synced to remote or not – before that was available by seeing the icon next to the branch.
Also, I find myself missing the color differences between “Added” and “Modified” as I’m now left with only A and M
How can I see the old Synchronization info? Like if I do a fetch, how can I see what I’m going to pull in, or if I’m doing a push of multiple commits, how can I see what’s in there?
This seems like a big downgrade from Team Explorer, especially for DevOps users. The functionality you need for managing source control is now split across a menu and a pane, when before it was altogether in one place. For instance, in Team Explorer it’s easy to switch to Branches and all the common stuff you want to do is right there (create a new branch, checkout a branch, merge/rebase branches). Plus, it always prompts you for the next likely step, like syncing, or creating a Pull Request, which is a great time saver and makes it easier to use.
If I was going to change Team Exporer to make it a Git only pane, then I would just do the following:
1. Add quick branch change, new branch, and sync (fetch, push, pull) to the existing Changes pane.
2. Add a checkout and pull option.
3. Have direct buttons/tabs to switch between Changes, Sync and Branches. If you’re removing the DevOps functionality then those are the only tabs you’re going to regularly switch between.
What I’d really like is to be able to associate a branch to a Work Item when creating it. Currently, you have to create the branch first, then remember to associate the Work Item when you commit.
I’d also like an easy way to force it to stop commits to branches protected by a branch policy in DevOps.
Just try and bear in mind that there’s a ton of developers who only have very basic Git knowledge and benefit from a simple UI that holds their hands to a certain extent (I don’t want to spend all my time having to sort out their Git issues).