Skip to main content
20 of 25
Add documentation link. Reword, shorten for clarity.
Mateen Ulhaq
  • 28.1k
  • 22
  • 122
  • 157

In the simplest terms, git pull does a git fetch followed by a git merge.


git fetch updates your remote-tracking branches under refs/remotes/<remote>/. This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I have even heard of people running git fetch periodically in a cron job in the background 1.

git pull brings a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.

From the Git documentation for git pull:

In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD.

1 although I wouldn't recommend doing this

Greg Hewgill
  • 1.0m
  • 193
  • 1.2k
  • 1.3k