Why do I see an error message when typing git remote add
?
$ git remote add origin remote repository https://github.com/hashanmalawana/Loginsystem.git
usage: git remote add [<options>] <name> <url>
-f, --fetch fetch the remote branches
--tags import all tags and associated objects when fetching
or do not fetch any tag at all (--no-tags)
-t, --track <branch> branch(es) to track
-m, --master <branch>
master branch
--mirror[=<push|fetch>]
set up remote as a mirror to push to or fetch from
You should type:
git remote add origin https://github.com/hashanmalawana/Loginsystem.git
not
git remote add origin remote repository https://github.com/hashanmalawana/Loginsystem.git
^^^^^^^^^^^^^^^^^^
That way, you add a remote named origin
, referencing the remote repo https://github.com/hashanmalawana/Loginsystem.git
And you won't see the usage message
usage: git remote add [<options>] <name> <url>
I understand that the step 8 of "Adding an existing project to GitHub using the command line" can be confusing:
git remote add origin remote repository URL
But the last three parameters are actually only one. It should read:
git remote add origin <remote repository URL>
It is better to refer to the actual man page for git remote
git remote add <name> <url>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With