Your repository has no remotes configured to push to

GitVisual Studio-Code

Git Problem Overview


I am using Visual Studio Code and running into the message below while trying to check in.

Your repository has no remotes configured to push to.

This is right after I upgrade from the April version on the Macintosh to the May version. I upgraded since I was getting an infinite progress bar during a git update. Does anybody have any ideas how to fix this? I have used the command line to verify that I do indeed have remotes configured. Can't post them here since it will show inter company info :(. Please help.

Git Solutions


Solution 1 - Git

Check the Github adding a remote article official doc which have better code highlighting and infos

but if you are an experienced user, just check out below commands and note that only the first command is required and second one is just for verifying and will return related repo details.

git remote add origin https://github.com/user/repo.git
    
git remote -v

Git Remote add Command dissection

Solution 2 - Git

Working with Remotes To be able to collaborate on any Git project, you need to know how to manage your remote repositories. Remote repositories are versions of your project that are hosted on the Internet or network somewhere. You can have several of them, each of which generally is either read-only or read/write for you. Collaborating with others involves managing these remote repositories and pushing and pulling data to and from them when you need to share work. Managing remote repositories includes knowing how to add remote repositories, remove remotes that are no longer valid, manage various remote branches and define them as being tracked or not, and more. In this section, we’ll cover some of these remote-management skills.

Showing Your Remotes To see which remote servers you have configured, you can run the git remote command. It lists the shortnames of each remote handle you’ve specified. If you’ve cloned your repository, you should at least see origin – that is the default name Git gives to the server you cloned from:

$ git clone https://github.com/schacon/ticgit

Cloning into 'ticgit'...

remote: Reusing existing pack: 1857, done.

remote: Total 1857 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (1857/1857), 374.35 KiB | 268.00 KiB/s, done.

Resolving deltas: 100% (772/772), done.

Checking connectivity... done.

$ cd ticgit

$ git remote

origin

You can also specify -v, which shows you the URLs that Git has stored for the shortname to be used when reading and writing to that remote:

$ git remote -v

origin	https://github.com/schacon/ticgit (fetch)

origin	https://github.com/schacon/ticgit (push)

Solution 3 - Git

Restart VS Code editor

use below commands on vscode:

command1: on vscode terminal change directory to project folder

to push your vscode on github:

command2: git push -u origin master

github signin popup will appear signed it

goto GitHub account repository and refresh it example-->> https://github.com/username/projectfoldername

it worked for me and I hope it will solve your problem now your VS Code file will be available on GitHub.

Solution 4 - Git

enter

git remote -v

if see like this result

origin https://github.com/xxx/yyy

Close Vs Code And Open Again

Solution 5 - Git

If you are using VS Code. 1.Go to View->Command pallete->git:add remote (This will create a remote) 2.Give a name(Usually the same as the project name) 3.It will now ask you to give a repository url, Create one and paste the link.

  1. You can commit and push accordingly.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKeithView Question on Stackoverflow
Solution 1 - GitImanView Answer on Stackoverflow
Solution 2 - GitRohit PoudelView Answer on Stackoverflow
Solution 3 - GitVinay RajbharView Answer on Stackoverflow
Solution 4 - GitMadadinoeiView Answer on Stackoverflow
Solution 5 - Gitavula vyasView Answer on Stackoverflow