Custom Keyboard Shortcut for Git Commands

Introduction:

 In this blog, you will learn how to add and customize the keyboard shortcuts for Git Commands.

Add Keyboard Shortcuts for Git:

From Visual Studio 2019 we have a Git menu. This menu has many commonly used options like Commit, stash, push, pull, and so on. I always prefer the keyboard shortcuts to perform some operations on the fly and there aren’t many available for Git in Visual Studio, hardly I see the shortcut available only for commit (Ctrl+0, Ctrl+G). Basically, for me, the pull is the one of most used actions in git, and let me explain the steps to add the shortcut for git pull.

  • Step 1: Open Options window from Tools->Options
  • Step 2: Under Environment-> Keyboard, search for Team.Git.Pull

I have entered Ctrl+T and Ctrl+P under the press Shotcut Keys textbox. I referred Ctrl+T for Team and Ctrl+P for pull.  Click on Assign and click on Ok.

Try Ctrl+T and Ctrl+P, this shortcut will execute the git pull command to pull the commits.  

Conclusion:

We have learned how to add a custom keyboard shortcut for git commands in Visual Studio. We will see more Visual Studio tips and tricks in my future blogs.

gowthamk91

Leave a Reply

%d bloggers like this: