learn git.
0/25 done
learn git/remotes and beyond/course 23 of 25

git pull: get the team's work

Someone else pushed. Here is how their commits reach you.

7 min read·3 sections·3 tasks
the key idea

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.

[bash]· the whole command
git pull

02Reading 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.

[bash]· download, then merge — quietly
From https://github.com/you/team-project
   a1b2c3d..f4e5d6  main       -> origin/main
Updating a1b2c3d..f4e5d6
Fast-forward
 list.txt | 2 +-
 1 file changed

03The 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
Pull before anything complicated

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.

[practice]· a real terminal, safely simulated
practice terminal — everything here is simulated, nothing can break
type 'help' to see the commands this terminal understands
~/my-project (main) $
Your tasks0/3 done
  1. 01.Pull the remote's new commits.

    hint: Type: git pull

  2. 02.Confirm the teammate's change arrived in list.txt.

    hint: Try: cat list.txt

  3. 03.Confirm their commit is in your history now.

    hint: Try: git log --oneline