Search code examples
githubrepositorygit-remote

Not able to add remote repository


I want to push changes from my local repository to my github repo. I start with the commands giving from github quickstep:

git init
git add .
git commit -m "first commit"

and then

$ git add origin https://github.com/Svein-Tore/forrigling.git
fatal: pathspec 'origin' did not match any files

Any suggestions to what can be wrong?


Solution

  • You've to use git remote add origin https://github.com/Svein-Tore/forrigling.git

    When you use git add origin, it tries to add the file 'origin'