0 votes
in DevOps by
What is the difference between Git pull and Git fetch?

1 Answer

0 votes
by
In the form of a simple equation,

Git pull = Git fetch + Git merge

The git pull command is used to pull any newly made changes or commits to a target

branch in your local repository from a branch from the central repository.

The git fetch command has the same purpose as well. However, instead of storing

the new changes and commits in the target branch, it stores them in a new branch.

To ensure that the changes reflect in the target branch as well, we have to use the

git merge command.

The equation comes in handy in remembering the function of each command.

Related questions

+1 vote
asked Aug 16, 2020 in Git by RShastri
+1 vote
asked Jul 25, 2019 in Git by SakshiSharma
...