Pull and fetch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
I'm still reading git tutorial.txt and I'm again confused.

  A more cautious Alice might wish to examine Bob's changes before
  pulling them.  She can do this by creating a temporary branch just
  for the purpose of studying Bob's changes:

  -------------------------------------
  $ git fetch /home/bob/myrepo master:bob-incoming
  -------------------------------------

  which fetches the changes from Bob's master branch into a new branch
  named bob-incoming.  (Unlike git pull, git fetch just fetches a copy
  of Bob's line of development without doing any merging).  Then

  -------------------------------------
  $ git log -p master..bob-incoming
  -------------------------------------

  shows a list of all the changes that Bob made since he branched from
  Alice's master branch.

OK, make sense. So let's try with an experiment:
paolo@paolo-desktop:~$ mkdir test
paolo@paolo-desktop:~$ cd test
paolo@paolo-desktop:~/test$ git-init-db 
defaulting to local storage area
paolo@paolo-desktop:~/test$ git fetch ../git master:testbranch
warning: no common commits
remote: Generating pack...
[skip]
paolo@paolo-desktop:~/test$ git pull ../git master:testbranchpull
* refs/heads/testbranchpull: storing branch 'master' of ../git
  commit: e945f95

Now I have 3 branches:
paolo@paolo-desktop:~/test$ git branch
* master
  testbranch
  testbranchpull

All the branches have the same content, I expect to see differences between testbranch 
and testbranchpull. The first one is the end result of a fetch, the second one is
the end result of a pull.

git status always says:
  nothing to commit

Why?
What will happen if I repeat the same commands:
  git fetch ../git master:testbranch
  git pull ../git master:testbranchpull
after a change in the git master branch?

Thanks in advance?

Kind regards,
Paolo Ciarrocchi

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]