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 pullThe history caught up
The jam snapshot sits at the top now.
$ git log --onelineThe file caught up too
The jam line arrived with the snapshot.
$ cat notes.txtExample
$ git pull
$ cat notes.txtKey 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?