Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Your repository has no remotes configured to push to

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.

like image 232
Keith Avatar asked Jun 15 '17 03:06

Keith


People also ask

How do I push code into my remote repository?

To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.

How do I push to remote repository in Visual Studio?

To push to your remote, select Push button, or select Push from the Git menu.

Why is push not working in git?

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 setup a remote git repository?

To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A unique remote name, for example, “my_awesome_new_remote_repo” A remote URL, which you can find on the Source sub-tab of your Git repo.


4 Answers

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

  • params:
    1. remote name: origin (a default name for a remote Repo in Git )
    2. remote url: https://github.com/user/repo.git (in this example)
like image 89
Iman Avatar answered Oct 18 '22 01:10

Iman


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)
like image 9
Rohit Poudel Avatar answered Oct 18 '22 02:10

Rohit Poudel


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.

like image 2
Vinay Rajbhar Avatar answered Oct 18 '22 02:10

Vinay Rajbhar


enter

git remote -v

if see like this result

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

Close Vs Code And Open Again

like image 1
Madadinoei Avatar answered Oct 18 '22 01:10

Madadinoei