Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to perform a git push automatically after committing in Visual Studio 2022?

Is it possible to automatically git push when I make a commit in Visual Studio 2022? I see the Commit All button by default, and I don't want to have to click the arrow beside it every time that I want to commit & push at the same time, which is the action I always do when I commit.

Visual Studio Code has a nice setting for this, but I didn't see a similar settings to configure it in Visual Studio.

like image 496
Matthew Kooshad Avatar asked Oct 31 '25 13:10

Matthew Kooshad


1 Answers

You can assign a keyboard shortcut to perform the commit and push instead of just commit.

Go to Tools → Options → Environment → Keyboard and optionally search the word "commit". Find the Team.Git.CommitAndPush shortcut and set it to what you wish. In this case, I remapped Team.Git.Commit (normally Ctrl + Enter) to Team.Git.CommitAndPush. When assigning the shortcut, be sure to select "Git" for the "use new shortcut in" drop down.

keyboard shortcut to set commit and push

After changing this, you can see that the drop down option now has the shortcut too:

commit and push drop down option with shortcut keys listed

like image 128
Timothy G. Avatar answered Nov 02 '25 02:11

Timothy G.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!