🎓 A1Learner
🔍
0 of 50 lessons completed

Pull Changes

Pull brings new work from the remote into your files. It is how you catch up with work others sent.

Bring the new work

The pull fast-forwards, because this copy had not moved.

$ git pull

The history caught up

The jam snapshot sits at the top now.

$ git log --oneline

The file caught up too

The jam line arrived with the snapshot.

$ cat notes.txt

Example

$ git pull
$ cat notes.txt

Key points

  • Pull with no names uses the link the first push made.
  • Pull runs a step called fetch first. Fetch only downloads the new work.
  • Then pull joins the new work into your branch.
  • A fast-forward means your branch had not moved.
  • The files change to match the newest snapshots.
  • Pull before you start work, so you build on the newest state.

Here, the pull adds the jam line. The file on this copy matches the file on the first copy.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

What does pull do?