One popular way for users to optimize their efficiency is to leverage shortcuts to interact with the UI. With Git tasks, like Committing, Pulling, and Pushing being part of your daily workflow, learning how to avoid leaving the keyboard for the mouse can keep you in the zone.
| Git Shortcuts | | Open Git Changes and shift focus to the Commit Message box | Alt+G, Ctrl+C | | Open the Git Repository Window | Alt+G, Ctrl+M | | Open the Branch Picker from the status bar | Ctrl+Alt, F3 | | Open the Repository Picker from the status bar | Ctrl+Alt, F4 | | Open the network operations context menu from the status bar | Ctrl+E, Ctrl+C |
Checkout some other shortcuts on this printable keyboard shortcut cheatsheet for Visual Studio available for download.
Try out the following Git keyboard workflows to see which shortcuts you can work into your daily practice. Not only can they help you be more productive and iterate quicker, but they can be easier to access for folks who don’t want to or are unable to move the mouse.
Create a New Branch with the Status BarOften, the first action of a new bug fix or some feature work is to create a new branch. To complete this action without using the mouse:
Commit Your Changes FasterOnce you update your code use Ctrl+S to save your work, then commit your changes without using the mouse:
Alternate Flow – Use the Diff View to quickly preview your changes
Quickly Navigate to View your Repo StatusWhenever you want to checkout manage your branches, use shortcut Alt+G, Ctrl+M to navigate quickly to the Git Repository Window. Again, using Tab and the Up and Down Arrows. Additionally, Alt+UP/DOWN arrows will allow you to navigate between sections, including the:
Learn more at Browse repos, compare branches & commits on Microsoft Learn.
Switch Active RepositoriesBack in the status bar, you can also use the shortcut Ctrl+Alt, F4 to open the Repository Picker which allows you to quickly switch active repositories, bringing up the Git Repository Window for review.
One Step Further with CustomizationTake the next step towards keyboard mastery by assigning your own Keyboard menu of the Options dialog. Get there by typing “Keyboard” into the search bar. For example, you can stage files using the keyboard, by assigning shortcuts to these commands:
To see all of the commands for git, type “Git” into the “Show commands containing:” search.
To learn more about how to customize key bindings checkout Identify and customize keyboard shortcuts.
Beyond Git ShortcutsThere’s a lot of content on Microsoft Learn to help you continue to make the most of the keyboard. You can start by checking out the most popular keyboard shortcuts for Visual Studio and dive deeper, including accessibility tips and tricks and learning how to use Visual Studio without a mouse. Find other productivity tips in the Productivity guide.
Thank YouThanks for checking out ways to boost your productivity with Git keyboard shortcuts. Hopefully, these flows demonstrate how to make incorporating Git into your daily coding sessions easy and unobtrusive. If you have any feedback, use Developer Community to report an issue or Suggest a Feature for Visual Studio.
The post Keyboard Shortcuts to Master Your Git Flow in Visual Studio appeared first on Visual Studio Blog.