Git:“git fetch”报告的数字是什么意思?
运行 git fetch 时,会给出一些数字:
$ git fetch upstream
remote: Counting objects: 77, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 47 (delta 19), reused 39 (delta 11)
Unpacking objects: 100% (47/47), done.
From http://github.com/jbossas/jboss-as
ef19bd4..b5015c1 master -> upstream/master
它们有什么用处吗?我想知道例如在该远程中发生了多少次提交。这些数据似乎不包含其中(在本例中为 5 次提交)。
(我知道我可以看到日志或其他任何东西;只是想知道那是做什么用的。)
When running git fetch, that gives some numbers:
$ git fetch upstream
remote: Counting objects: 77, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 47 (delta 19), reused 39 (delta 11)
Unpacking objects: 100% (47/47), done.
From http://github.com/jbossas/jboss-as
ef19bd4..b5015c1 master -> upstream/master
Are they useful in any way? I'd like to know e.g. how many commits was fetched happened in that remote. Which seems not to be contained in these data (in this case, it was 5 commits).
(I know I can see log or whatever to see that; just wonder what's that for.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是要获取(或必须获取)的对象数量。对象可以是以下任何内容:
blob
、tree
、commit
或tag
。因此,最简单的提交将由 2 个对象组成:
commit
对象和(空)tree
对象。添加一个文件,你就得到了三个对象:commit+tree+blob。要对获取的提交进行计数,请使用 git rev-list 来解析提交范围 ef19bd4..b5015c1:
It's how many objects are going to be fetched (or had to be fetched). An object can be anything of:
blob
,tree
,commit
ortag
.So, the most simplest commit would be composed of 2 objects: The
commit
object and the (empty)tree
object. Add one file, and you've got three objects: commit+tree+blob.To count the fetched commits, use
git rev-list
to parse the commit rangeef19bd4..b5015c1
: