Get to Know Git: Lesson 7 of 14

Pushing Local to Remote

Up Next

Cloning Repositories

Autoplaying in 7 seconds!


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 (

Table of Contents

    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

    Chris Sevilleja

    176 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.