Reputation: 3545
I'm new to Git/GitHub. Trying to push my files to a new repo I have set up and it's not working. Here's my process:
git remote add origiN <URL>
git remote -v
This seems to all go to plan, as Terminal returns
origiN <URL> (fetch)
origiN <URL> (push)
...as expected.
Then, when I run git push
, I get:
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
...but I thought I had already configured the remote repository?
What am I missing?
Upvotes: 0
Views: 174
Reputation: 312770
psydroyd answered whilst I was typing, but here is slightly more detail:
A repository can have multiple remotes. You can push to a remote explicitly by running:
git push <remote> <branch>
But if you want git push
to work without any additional parameters, you can use the --set-upstream
option, aka -u
, as in:
git push -u origin master
This sets up your local branch to track the remote master
branch. After this point, you can run:
git push
Upvotes: 2