Under the hood, git pull
is git fetch
followed by git merge
. Here's the fetch portion:
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 2), reused 0 (delta 0)
At this point, you've told the remote what you want. It finds all the objects it needs to give you (counting them in the process, I believe), compresses them for faster transfer over the network, and then reports what it's sending you. Objects may be blobs, trees, commits, or tags - see for example the git book for more information.
Unpacking objects: 100% (7/7), done.
You receive the pack (set of compressed objects) and unpack it.
From ssh://my.remote.host.com/~/git/myproject
* branch master -> FETCH_HEAD
You've fetched the branch 'master' from the given remote; the ref FETCH_HEAD now points to it. Now we move on to the merge - precisely, git will merge FETCH_HEAD (the remote's master branch) into your current branch (presumably master).
Updating 9d447d2..f74fb21
Fast forward
It turns out that you haven't diverged from the remote's master branch, so the merge is a fast-forward (a trivial merge where it simply moves you forward in the history). Git notes the original position of your master branch (9d447d2) and the new position (f74fb21) it's been fast-forwarded to. If you had diverged from the remote's master branch, you'd see the output of a recursive merge here - Merge made by recursive
, possibly along with some Auto-merged <file>
and (oh no!) merge conflicts!
app/controllers/myproject_controller.rb | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
Finally, it shows you the diffstat between the original and post-merge position of your master branch; this is basically what you'd get from git diff --stat master@{1} master
.