What does Fast-forward mean when pulling from remote?
Asked Answered
S

2

14

I run git pull twice and get the following out:

$ git pull
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (1/1), done.
From git.assembla.com:my-project
   da3f54c..bb335a4  master     -> origin/master
Updating 5934c67..bb335a4
Fast-forward

$ git pull
Already up-to-date.

How to understand this output?

Squamous answered 17/4, 2014 at 17:17 Comment(0)
D
16

You've pulled the remote origin/master branch into your local master branch.
The two branches have not diverged, there were just some new commits on origin/master.
So your local master was fast-forwarded to origin/master without any merge.

Git branches are lightweight, they are just moving labels, pointing to certain commits.

Desensitize answered 17/4, 2014 at 17:21 Comment(0)
I
4
  1. From Pro Git:

    Because the commit pointed to by the branch you merged in was directly upstream of the commit you’re on, Git moves the pointer forward. To phrase that another way, when you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together — this is called a "fast forward".

  2. Already up-to-date means the remote didn't have any changes to provide to you, so nothing happened.

Insomnia answered 17/4, 2014 at 17:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.