AndreaNobili AndreaNobili - 1 year ago 114
Git Question

Why I can't add this remote GitHub repository to my local GIT repository as remote?

I am absolutly new in GIT and GitHub and I have the following problem trying to link my local repository to a GitHub account

I do:

Andrea@Andrea-PC MINGW64 ~/Documents/WS_vari/version-control/recipes (master)
$ git remote set-url origin
fatal: No such remote 'origin'

where is the https link provided by GitHub for this repository.

Why I obtain this error message? What means No such remote 'origin'? How can I fix this issue?

Answer Source

The command you are using is not adding a remote but setting the URL of an existing remote. The command you are looking for is

git remote add origin

set-url can be used if you want to change an URL or fix a typo:

# Note the typo in the URL:
git remote add origin
# This command fixes the typo:
git remote set-url origin
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download