fetch vs pull, tracking branches, and keeping your local repo in sync without surprises
The fetch-vs-pull distinction is one of the most common sources of "why did my code get overwritten?" moments on teams. Understanding that git fetch only downloads — and never touches your working directory — gives you safe, predictable control over how and when local branches integrate remote changes.
Remote-tracking branches like origin/main are local read-only snapshots of what the remote looked like last time you communicated. git fetch updates these snapshots without touching anything else. git pull = fetch + merge (or rebase). Think of origin/main as a cached copy, not a live view — you must fetch to refresh it.
Fetching before inspecting gives you full visibility into incoming changes before they touch your branch. It is always safe — nothing changes locally until you explicitly merge or rebase.