Collaborating with a software project that uses Git requires that you keep your repository in sync with this remote repository. The focus of this chapter is the command that helps you keep in sync: git pull.
git pull is the opposite operation of git push. You’ll learn how to use git pull to bring in changes that were made in the remote repository you’re tracking.
This is the step that keeps you in sync! You’ll also learn that git pull consists of two commands: git fetch and git merge. You learned about git merge in chapter 10, but knowing how it’s used in conjunction with git fetch will help you understand issues you might have with git pull.
You’ve learned about clones (chapter 11) and how the git remote command (chapter 12) enables you to push to a remote (chapter 13). In figure 14.1, your clone (math.carol) can fetch (pull) from the remote (math.git), in addition to push.
When you make a clone of a repository, Git creates a remote that enables your clone to both push and pull from the repository that you just cloned. The remote sets up a cycle of collaboration. In section 14.2, you’ll learn that git pull comprises two commands: git fetch and git merge. That’s why figure 14.1 labels the arrow from math.git to math.carol as fetch (pull).