Fetch vs Pull: The Critical Difference
A real teammate commits while you're away. See exactly what fetch shows you — and what pull actually does about it.
While you were mapping out the project, a real contributor pushed a genuine new commit straight to master. This is the real, everyday shape of team collaboration: work happens whether or not you are watching.\n\ngit fetch is the safe, look-first move — it downloads the new commit and updates origin/master, and genuinely nothing else. git pull goes one step further, actually merging (or, as here, fast-forwarding) that new commit into your own branch. Doing them separately, once, makes the real boundary between the two unmistakable.
Fetch: Look, Don't Touch
git fetch origin
git log --oneline origin/master -2
git log --oneline master -2
origin/master genuinely moved to the new commit. Local master — and the actual working directory — are completely untouched.
Pull: Now Actually Catch Up
git pull
Since local master had made no commits of its own, this is a genuine fast-forward: local master's pointer simply advances to match origin/master, no merge commit needed.
When Fetch Alone Is the Safer Move
Fetching first, then inspecting origin/master before deciding to merge, is genuinely safer whenever you are mid-way through something uncommitted, or when the incoming change is large enough that you want to review it before it touches your working directory. Pull collapses that inspection window into a single step — fine most of the time, risky the moment you actually needed to look first.
Fast-forward
When the current branch has made no commits of its own since diverging, "merging" in new commits is genuinely just moving the branch pointer forward — no merge commit is needed, since there is nothing to combine. Confirmed directly in this lab: git pull reported "Fast-forward", not a merge.
📡 Fetch and Confirm the Real Separation
Download what changed on the remote, and confirm your own branch and files are untouched.
cd ~/team-recipes && git fetch origincd ~/team-recipes && git log --oneline origin/master -2cd ~/team-recipes && git log --oneline master -2cd ~/team-recipes && ls hot-chocolate.mdstudent@lab:~$ cd ~/team-recipes && git fetch origin remote: Enumerating objects: 4, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), 332 bytes | 20.00 KiB/s, done. From ../recipes-origin 5062570..d891fe9 master -> origin/master student@lab:~$ cd ~/team-recipes && git log --oneline origin/master -2 d891fe9 (origin/master, origin/HEAD) Add hot chocolate recipe 5062570 (HEAD -> master) Merge remote-tracking branch 'origin/master' student@lab:~$ cd ~/team-recipes && git log --oneline master -2 5062570 (HEAD -> master) Merge remote-tracking branch 'origin/master' dd878a3 Add iced coffee recipe student@lab:~$ cd ~/team-recipes && ls hot-chocolate.md ls: hot-chocolate.md: No such file or directory
⬇️ Pull to Actually Catch Up
Bring the fetched commit into your own branch for real.
cd ~/team-recipes && git pullcd ~/team-recipes && git log --oneline master -2cd ~/team-recipes && ls hot-chocolate.mdstudent@lab:~$ cd ~/team-recipes && git pull Updating 5062570..d891fe9 Fast-forward hot-chocolate.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 hot-chocolate.md student@lab:~$ cd ~/team-recipes && git log --oneline master -2 d891fe9 (HEAD -> master, origin/master, origin/HEAD) Add hot chocolate recipe 5062570 Merge remote-tracking branch 'origin/master' student@lab:~$ cd ~/team-recipes && ls hot-chocolate.md hot-chocolate.md
Lab 2.1.2 complete. The real boundary between fetch and pull, seen directly rather than described:\n\n\n Fetch: origin/master moved, nothing else : ✅ confirmed\n Pull: real fast-forward, files updated : ✅ confirmed\n
Enable JavaScript to run the live terminal and track your progress.