Git

What is the difference between git pull and git fetch?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

Shortly, git pull = git fetch + git merge

When you run git pull, it gets all the changes from the remote or central repository and attaches it to your corresponding branch in your local repository.

git fetch gets all the changes from the remote repository, stores the changes in a separate branch in your local repository