Remotes are other repositories—usually on GitHub/GitLab. origin is the default name for the server you cloned from.
Push and pull
git remote -v
git fetch origin
git pull origin main # fetch + merge
git push origin main
Pull requests
Push a branch, open a PR, request review, run CI, then merge. This is the daily loop in most product teams.
Self-check
- How is
fetchsafer thanpullfor beginners? - What does
originmean?
Interview prep
- What is the difference between <code>git fetch</code> and <code>git pull</code>?
Fetch downloads remote commits without merging them into your branch. Pull usually means fetch plus merge (or rebase)—faster but less explicit for beginners.
- What is <code>origin</code>?
The conventional name for the default remote (often where you cloned from). It is just a label for a URL—inspect with
git remote -v.