-1

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?

Gulzar
  • 17,272
  • 18
  • 86
  • 144

3 Answers3

1

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.

mnestorov
  • 3,508
  • 2
  • 14
  • 22
0

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

Nithish
  • 4,733
  • 2
  • 6
  • 23
0

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.

belaassal
  • 133
  • 6