git pull: get the team's work
Someone else pushed. Here is how their commits reach you.
git pull downloads the remote's new commits and merges them into your branch — fetch and merge in one command.
01What pull does
You are not alone on the project. While you worked, a teammate committed and pushed — their photographs are on the remote, and your copy does not have them yet. git pull brings you up to date: it downloads the new commits and merges them into your branch, in one command.
Under the hood pull is really two commands wearing one name: fetch, which downloads; and merge, which combines. You will hear both words. For daily life, pull is the whole story.
git pull02Reading the reply
The output has two halves. The From https://... block is the download — git naming the remote and listing what arrived, with the old and new positions of the branch. The Updating block is the merge — your branch moving forward to include the new work, announced by Fast-forward when it slid in cleanly.
When it does not slide in cleanly — when their changes and yours touch the same lines — pull raises exactly the conflict you already know from course 18. Same markers, same resolution: edit, add, commit. Nothing new to learn; the skill transfers whole.
From https://github.com/you/team-project
a1b2c3d..f4e5d6 main -> origin/main
Updating a1b2c3d..f4e5d6
Fast-forward
list.txt | 2 +-
1 file changed03The daily rhythm with a team
The professional loop grows one step at each end: pull at the start — get everyone's work so you build on the latest truth; work in the middle, exactly as you have learned; push at the end — hand your work back. Pull, work, push. When several people share a branch, the habit is to pull often, so the gaps between your copy and the shared truth stay small.
- —start: git pull
- —middle: edit, add, commit — offline as always
- —end: git push
About to merge, about to start the day, about to push? Pull first. Most team friction comes from working on an old copy of the truth.
Practice
While you were reading this, a teammate pushed a change to the remote. Go get it.
01.Pull the remote's new commits.
hint: Type: git pull
02.Confirm the teammate's change arrived in list.txt.
hint: Try: cat list.txt
03.Confirm their commit is in your history now.
hint: Try: git log --oneline