Below are the basic difference between git pull and git fetch.
- When you use
git pull, Git tries to merge your changes automatically to the remote branch. Git merges any pulled contributions into the branch you’re presently working on because it’s context sensitive. Without allowing you to see the commits first, pull merges them automatically. You may experience frequent disagreements if you do not carefully manage your branches.
- While using
git fetch, it fetches any commits from the target branch that do not exist in your current branch and stores them in your local repository. It does not, however, combine them with your current branch. This is especially useful if you need to maintain your repository up to date but are working on something that might break if your files are updated. You must next use merge to integrate the commits into your existing branch.
Basically we can say that
git pull =
git fetch +