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.
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.
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.
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.
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!
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 !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With