VS Code Git push is not pushing the code to remote

First of all check whether you have already configured GIT on environment variables. If so, simply run below commands on VS Code terminal

$>git --version 

Expected output

git version 2.28.0.windows.1

Use the command below to avoid prompt of git credentials every time and set it at global level

$>git config --global credential.helper wincred 

This will push your code to git repository

$>git push origin master

Try again, with push menu on VS Code.

Hope that helps !


I was just experiencing something similar. Although the issue OP describes is the push continuing to sync but failing to connect, in what sounds like an initial commit. In my case it appeared as though all pushes were successful, in an existing repo/project where I've never had issues, nor had to do any initial git configurations inside VS... Things have always just worked, until the past few days, I just noticed none of my pushes actually made it to the repo.

But the title of the post is still relevant, so I'll answer in case it helps anyone else:

A simple VS Code update fixed my issue. While troubleshooting, I noticed a notification on the gear icon in the bottom left - which was an update ready to install. Once the update was installed and VS code restarted, I tried another pull, and then a push and everything's back to normal. Three commits finally found their way to the repo.