git fetch vs git pull — What's the Difference?
git fetch downloads new commits and branches from a remote without changing any of your local branches, letting you review changes before merging.
Published September 27, 2026
git fetch downloads new commits from the remote without changing your working files; git pull fetches and then merges them into your current branch. Fetch is the safe way to look first.
How it works
After fetch you can inspect origin/main with git log or git diff before deciding to merge or rebase.
pull is simply fetch plus an immediate integration step.
Try it
git fetch origin
From github.com:me/app main -> origin/main
git log HEAD..origin/main --oneline
a1b2c3 Add search
Practical examples
See what is new
git fetch
git log HEAD..origin/main --onelineCompare before merging
git diff HEAD origin/mainIntegrate when ready
git merge origin/main # or git rebase origin/mainFetch and prune deleted branches
git fetch --pruneCommon mistakes
- Assuming fetch updates your working files.
- Pulling blindly into a dirty working tree.
- Forgetting --prune and keeping stale remote branches.
Key takeaways
- fetch = download only.
- pull = fetch + integrate.
- Fetch first when unsure.
FAQ
Which is safer?
fetch, because it never changes your files.
How do I update all remotes?
git fetch --all.