Remote Repositories Basics
Everything so far lived on your laptop alone. This module connects it to the rest of the world — GitHub, GitLab, and the code your team is actually shipping.
Why This Module Matters
A local repository is a private notebook. Useful, but nobody else can read it, and it disappears with your hard drive. A remote is the shared copy that lives on a server: it is how your test suite becomes the team's test suite, how your colleague's fix reaches your machine, and how you get the code you're supposed to be testing in the first place.
There are only three moves to learn here, and you will use all three every week. Connect a repository to a remote. Send your commits up. Bring other people's commits down. That's it — the rest of GitHub is a website wrapped around those three ideas.
What You'll Learn
- What a remote is, what
originmeans, and howgit remote add origin <url>wires the two together - How to publish local work with
git push -u origin main, and what that-uactually buys you - How
git clonegets you a full copy of a project — history included — in one command - How
git pullbrings the latest changes from the server into your working directory - The everyday QA rhythm: pull before you start, push when you finish
Pro Tip
Pull before you push. Almost every "Git rejected my push" panic is Git politely telling you that someone else committed while you were working, and that you should get their changes first. It is not an error. It is a traffic light.