When pulling, i noticed git fetch
behavior also occurs.
I assume a pull is actually
pull = fetch + x
I was wondering if this is the case, and if so, what is x
?
Per the git pull
documentation
Incorporates changes from a remote repository into the current branch. In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD.
So the missing x
is a merge
, for the default behavior.
What git pull
does is git fetch
followed by a git merge
.
More precisely, git pull
runs git fetch
with the given parameters and calls git merge
to merge the retrieved branch heads into the current branch
fetch really only downloads new data from a remote repository - but it doesn't integrate any of this new data into your working files.
pull, in contrast, is used with a different goal in mind: to update your current HEAD branch with the latest changes from the remote server.