Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Fast-forward mean when pulling from remote?

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?

like image 375
abg Avatar asked Apr 17 '14 17:04

abg


2 Answers

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.

like image 87
SzG Avatar answered Oct 14 '22 12:10

SzG


  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.

like image 45
Carl Norum Avatar answered Oct 14 '22 12:10

Carl Norum