In short: git pull
= git fetch
+ git merge
It’s always perfectly safe to do a git fetch
and it won’t change your local repository.
But when you run git pull
, Git will also try to intelligently perform a git merge
- and in the process, it will merge all the upstream commits without asking you to individually verify them.
Here’s a good chart to help you understand what happens when you run each of the most common Git command:
Source: Oliver Steel’s blog