-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
  • 23,452
  • 27
  • 113
  • 201

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
  • 4,116
  • 2
  • 14
  • 24
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
  • 5,393
  • 2
  • 9
  • 24
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