Get to Know Git

Pushing Local to Remote

To view what remote repositories are attached to your current repo:

git remote -v

The default main remote repo is called the origin. If you don't yet have an origin set, you can set it using:

git remote add origin

Notice we are using the SSH url ( vs the HTTPS url (

Once you've added that remote, you can push to it after telling git how to map the branches. Here we'll map master local branch to a master remote branch.

git branch --set-upstream-to=origin/master master

Then we can push!

git push

Like this article? Follow @chrisoncode on Twitter