AndreaNobili AndreaNobili - 2 months ago 15x
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?


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