git pull的输出实际上意味着什么? [英] What does the output of git pull actually mean?

查看:196
本文介绍了git pull的输出实际上意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以给我一个简单的逐行解释,说明什么是基本的git pull 输出方式?示例:

  remote:计数对象:11,完成。 
remote:压缩对象:100%(5/5),完成。
remote:合计7(delta 2),重用0(delta 0)
开箱对象:100%(7/7),完成。
从ssh://my.remote.host.com/~/git/myproject
*分支大师 - > FETCH_HEAD
更新9d447d2..f74fb21
快进
app / controllers / myproject_controller.rb | 13 +++++++++++++
1个文件已更改,13个插入(+),0个删除( - )


解决方案 git pull 后跟 git merge 。以下是获取部分:

  remote:计数对象:11,完成。 
remote:压缩对象:100%(5/5),完成。
remote:合计7(delta 2),重用0(delta 0)

点,你已经告诉遥控器你想要什么。它发现它需要给你的所有对象(我相信在过程中对它们进行计数),压缩它们以便在网络上更快地传输,然后报告它发送给你的内容。对象可能是blob,树,提交或标签 - 请参阅例如 git

 开箱对象:100%(7/7),完成。 

您会收到包(压缩对象集)并将其解压缩。

 从ssh://my.remote.host.com/~/git/myproject 
* branch master - > FETCH_HEAD

您从给定的远程获取了分支'master' FETCH_HEAD现在指向它。现在我们继续进行合并 - 确切地说,git会将FETCH_HEAD(远程的主分支)合并到当前分支(大概是master)。

 更新9d447d2..f74fb21 
快进

事实证明, t从远程的主分支中分离出来,所以合并是一个快进(一个简单的合并,它简单地将你推向历史)。 Git记录了您的主分支(9d447d2)的原始位置以及它已被快速转发的新位置(f74fb21)。如果你已经从远程的master分支中分离出来,你可以看到递归合并的输出 - 通过递归合并,可能还有一些自动合并< file> 和(哦不!)合并冲突!

  app / controllers /myproject_controller.rb | 13 +++++++++++++ 
1个文件已更改,13个插入(+),0个删除( - )

最后,它会显示您的主分支的原始位置和合并后位置之间的差异;这基本上是你从 git diff --stat master @ {1} master 获得的。


I'm trying to gain a more thorough understanding of git.

Can someone give me a simple line-by-line explanation of what basic git pull output means? Example:

remote: Counting objects: 11, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
From ssh://my.remote.host.com/~/git/myproject
 * branch            master     -> FETCH_HEAD
Updating 9d447d2..f74fb21
Fast forward
 app/controllers/myproject_controller.rb |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

解决方案

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.

这篇关于git pull的输出实际上意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆