VS Code : Automatically Push after Commit

If you want to automatically push to a GitHub repository after commit, Gitlens extension in VS Code has a setting to make this possible. You just change the git.postCommitCommand setting and then when you commit and it pushes simultaneously.

  1. Open GitLens Extension Settings.
  2. Search for git.postCommitCommand .
  3. click on the dropdown menu and change none to push

That’s it. Now every time you commit to your Github repository, it is pushed automatically.