Missing ctrl + enter in Visual Studio to commit changes? Here’s how you can add it

category: [ VSTS / TFS ] tags: [ git ] [ Visual Studio ]
created: 18 Mar 2019 @ 21:21 modified: 19 Mar 2019 @ 15:35


So something that you've probably noticed when using dev tools in the web and Visual Studio Code is that you can hit ctrl + enter and with this you may have noticed that in Visual Studio you can't do that. Below you'll see how you can add this to your IDE.

Adding keyboard shortcuts for Team Explorer

First off open Visual Studio and press ctrl + Q to jump to the search VS textbox and then type keyboard and then select Change hotkeys and keyboard shortcuts.

image

This will open the Options dialog to the Keyboard section under environment.

  1. First off type team.git.commit in the show commands containing field
  2. Select Team.Git.Commit
  3. Select Team Explorer from the Use new shortcut in
  4. In the Press shortcut keys textbox press ctrl + enter
  5. Click Assign

image

You can repeat this if you want for Commit and Sync and assign the shortcut ctrl + shift + enter.

Having this shortcut can help improve your flow a lot. If you want to 'switch' to the commit screen you could make the Use new shortcut in drop list as Global and it will switch to changes (because there is no comment, if there is a comment it's going to just commit so beware of that).

EDIT: To go to Commit changes window from anywhere you can bind Team.Git.GoToGitChanges as Global and that will jump to the window Smile.

ABOUT ME

Gordon Beeming works at Derivco in the sunny city of Durban, South Africa. When he's not hacking away at a keyboard in Visual Studio he'll generally be relaxing with his family or hitting the black top getting in some mileage. He is a Visual Studio ALM Ranger and Visual Studio ALM MVP.

Follow me on Strava

TOOLS

I plan on writing a bunch of online tools and sharing the code for how I made those tools. If you have any feedback you can ping me on Twitter (@GordonBeeming) or mail me [email protected].