Git was designed so that people on an unreliable link could exchange code via email, even.
In order to support this model git maintains a local repository with your code and also an additional local repository that mirrors the state of the remote repository. By keeping a copy of the remote repository locally, git can figure out the changes needed even when the remote repository is not reachable.
Later when you need to send the changes to someone else, git can transfer them as a set of changes from a point in time known to the remote repository.
git fetchis the command that says bring my local copy of the remote repository up to date.
git pullsays "bring the changes in the remote repository where I keep my own code."
git pull does this by doing a
git fetch to bring
the local copy of the remote repository up to date, and then merging
the changes into your own code repository and possibly your
The take away is to keep in mind that there are often at least three copies of a project on your workstation.
Casiano Rodriguez León 2015-06-18