git clone的进度指示器 [英] Progress indicator for git clone

查看:885
本文介绍了git clone的进度指示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行 git clone 时可能获得进度条吗?我想知道是因为我目前正在做一个到目前为止花了几分钟时间的git克隆,并且很想知道它是否会很快完成。

解决方案

不是。有许多阶段 git clone


  1. 发现需要的对象已发送(计数对象:nnn)

  2. 压缩并发送这些对象

  3. 索引收到的包

  4. 检出收到的文件

第1阶段涉及遍历每个分支头部的提交图表,查找所有提交和关联对象:因为那里事先并不知道有多少次提交,这个进度是无法衡量的。不幸的是,这通常是克隆操作中很多时间被占用的地方。



阶段2确实有一个进度计数器,虽然它计数的是对象而不是体积(所以它的利率会有所不同,特别是如果回购有大量的斑点)

阶段3和阶段4具有进度计数器,尽管它们通常比前两个阶段快得多。


Is it possible to get a progress bar when doing a git clone? I'm wondering because I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.

解决方案

Not really. There are various stages to git clone:

  1. discover the objects that need to be sent ("Counting objects: nnn")
  2. compress and send those objects
  3. index the received pack
  4. check out received files

Stage 1 involves walking through the commit graph from each branch head finding all the commits and associated objects: since there is no idea beforehand of how many commits there are, the progress of this can't be gauged. Sadly this is often where a lot of the time in a clone operation is taken up.

Stage 2 does have a progress counter, although it counts objects rather than volume (so its rate varies, especially if the repo has large blobs)

Stages 3 and 4 have progress counters, although they are usually much faster than the previous two stages.

这篇关于git clone的进度指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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