The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

What is the difference between git pull and git fetch + git rebase? – Stack Overflow

Posted by jpluimers on 2026/02/04

Great Question, Answer and Comment at [Wayback/Archive] What is the difference between git pull and git fetch + git rebase? – Stack Overflow (thanks [Wayback/Archive] michael, [Wayback/Archive] gawkface and [Wayback/Archive] Daniel K.):

Q

Another question says that git pull is like a git fetch + git merge.

But what is the difference between git pull and git fetch + git rebase?

A

TLDR:

git pull is like running git fetch then git merge
git pull --rebase is like git fetch then git rebase

In reply to your first statement,

git pull is like a git fetch + git merge.

“In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD” More precisely, git pull runs git fetch with the given parameters and then calls git merge to merge the retrieved branch heads into the current branch”

(Ref: git-scm.com/docs/git-pull)

For your second statement/question:

‘But what is the difference between git pull VS git fetch + git rebase

Again, from same source:
git pull --rebase

“With –rebase, it runs git rebase instead of git merge.”

Now, if you wanted to ask

‘the difference between merge and rebase

that is answered here too:
git-scm.com/book/en/v2/Git-Branching-Rebasing
(the difference between altering the way version history is recorded)

C

I’d like to mention that “git pull –rebase” is like “git fetch then git rebase” most of the time – but not always. In some situations, “git pull –rebase” does a bit more. See this often referenced example here: gitolite.com/git-pull–rebase

References from them:

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.