What a Remote Is

What this is. Everything so far has been entirely local. A remote is a copy of your repository somewhere else, usually on GitHub, that you can send commits to and fetch commits from.

Git is the tool. GitHub is a host for git repositories, plus a large amount of collaboration machinery on top. They are separate things, and plenty of projects use git with no GitHub at all.

The commands.

git remote add origin URL records where the remote lives, naming it origin by convention.

git remote -v shows what is configured.

git push sends your commits up.

git pull brings other people's commits down.

git clone URL copies an existing remote repository to your machine, remote already configured.

✦ origin is a name, not a keyword

Nothing about git requires the word origin. It is simply the conventional name for the remote you cloned from or created first. You could call it anything, and projects with several remotes give them different names. Knowing it is just a label removes a surprising amount of confusion.

SANKOFA SANDBOX
learner:~$

Pushing here is simulated, but the sequence, the errors, and the up to date behavior are accurate.

Try it → Init and commit the portfolio, then run `git push` with no remote configured and read the error. Then `git remote add origin https://github.com/you/portfolio.git`, `git remote -v`, and `git push`. Then push a second time.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: GitHub, and Publishing the Site →
← Back