Pulling vs. fetching in Git

David Y.

The Problem

What is the difference between git pull and git fetch?

The Solution

The git fetch command updates the remote tracking branches in a repository. In other words, it pulls the latest versions of the remote repository’s branches without applying any changes to local branches.

The git pull command performs a git fetch and then a git merge or git-rebase on the current branch in the local repository. In other words, it updates the repository’s remote-tracking branches and then brings the current local branch up to date with its remote version.

Join the discussionCome work with us
Share on Twitter
Bookmark this page
Ask a questionImprove this Answer

Related Answers

A better experience for your users. An easier life for your developers.

© 2023 • Sentry is a registered Trademark
of Functional Software, Inc.