Remotes: the album, on the internet
Git vs GitHub in two minutes, then the commands that connect them.
A remote is just a copy of your repository on another computer — same album, different location.
01The same album, somewhere else
Everything so far happened on your machine, offline — and that never stops being true. Commits, branches, merges: all local. A remote is a copy of your repository living on another computer, usually a server belonging to a site like GitHub. Same album, same history, different building.
Why keep a copy elsewhere? Two reasons, and they are both human. Backup: your laptop can die, and the album survives. Collaboration: other people can send their photographs to the same remote, and everyone ends up holding the same full history.
- —git — the tool on your computer (every course before this one)
- —GitHub — a website that hosts a copy of your repository
- —remote — git's word for that copy, wherever it lives
Git works fully offline. GitHub is one popular website that hosts git repositories. You can use git your whole life without GitHub — you cannot use GitHub without git.
02The name origin
When you connect a repository to a remote, git needs a short nickname for that URL, because you will type it constantly. The whole world settled on the name origin — the place your project came from, or the place it is going. It is a pure convention: origin is not special to git, it is just the name everyone uses, so everyone's commands look the same.
| term | what it means |
|---|---|
| remote | a copy of your repository, elsewhere |
| origin | the conventional nickname for your main remote |
| push | upload your new commits to the remote |
| pull | download other people's commits from the remote |
git remote add origin https://github.com/you/your-project.git03Two verbs to rule them all
The entire social side of git is two verbs. git push uploads your new commits to the remote — sharing your work. git pull downloads commits other people pushed and merges them into your copy — receiving theirs. Everything else about teams is just those two, well-timed.
Your daily loop does not change: edit, add, commit — offline, as always. Sharing is a separate, optional step at the end. The next three courses practise exactly these moves: clone, push, pull.
git remote -vPractice
This repository has no remote yet. Confirm that, so you recognise the empty state.
01.Ask git about its remotes.
hint: Try: git remote -v (or just: git remote)
02.Confirm no remote is connected yet.