Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Git push is not pushing the code to remote

I cloned a GIT repo in my device and started editing the code using VSCode. Then I made several changes to my code and committed it successfully.

But when I tried to push it from push menu it doesn't seem to be working. It shows that it's syncing, but that goes on forever.

I couldn't find any settings to configure credentials of git.

like image 350
Steve121 Avatar asked Sep 12 '17 11:09

Steve121


People also ask

Why is GitHub not pushing my code?

This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes (e.g., 'git pull ...') before pushing again." That means your local repository is outdated and there are some new changes in remote repository which are not present in local.

Why is my git push not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

How do I push code into remote repository in Visual Studio?

Visual Studio GitIn the Git Changes window, select the up-arrow push button to push your commit. Or, you can push your changes from the Git Repository window. To open the Git Repository window, select the outgoing / incoming link in the Git Changes window.

Does git push push to all remotes?

The objective is to push to multiple Git remotes with a single git push command. If you don't want to create an extra remote named all , you can skip the first command and use the remote origin instead of all in the subsequent command(s). Now, you can push to all remote repositories with a single command!


1 Answers

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 !

like image 188
napster Avatar answered Oct 30 '22 03:10

napster