2

most likely I am missing something here.

Why does

git fetch origin master

with the output

remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From https://github.com/groupschoof/PhyloFun
 * branch            master     -> FETCH_HEAD

and a subsequent

git merge origin/master

give the output

Already up-to-date.

While

git pull origin master

does

From https://github.com/groupschoof/PhyloFun
 * branch            master     -> FETCH_HEAD
Updating c6bd22b..234cd22
Fast-forward
 R/geneOntologySQL.R |   77 ++++++++++[rest of line omitted]
 1 file changed, 30 insertions(+), 47 deletions(-)

So in short why does a git pull origin master trigger the merging of fetched patches, while the combined git fetch origin master and subsequent git merge origin/master does not?

For enlightenment I will be very grateful!

Cheers!

user3139868
  • 393
  • 2
  • 12

1 Answers1

0

So in short why does a git pull origin master trigger the merging of fetched patches, while the combined git fetch origin master and subsequent git merge origin/master does not?

Firstly, since git 1.8.4, git fetch will always update origin/master in addition of FETCH_HEAD: see "git fetch, FETCH_HEAD and origin/master".
That means a git merge origin/master will always return a Already up-to-date message.

Secondly, git pull is a git fetch + a git merge on the current local branch (not remote tracking branch): it merges on master, not origin/master.

The (fast-forward) merge seen in the question is the master branch being updated.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250