这是我的问题:
当我对一些大型存储库进行 pull/获取时,我想在控制台以外的其他地方显示进度(例如在网站上) 我知道在 git 1.7.1.1 中有选项 --progress 但我不能使用这个版本并且必须留在 1.6.0.4
有没有人知道如何查看 git fetch/pull 进度(例如如何提取当前下载百分比)
最佳答案
我不确定如何做到这一点,因为 --progress 选项已在 upload-pack.c
Invoked by
git fetch-pack
, learns what objects the other side is missing, and sends them after packing.This command is usually not invoked directly by the end user.
The UI for the protocol is on thegit fetch-pack
side, and the program pair is meant to be used to pull updates from a remote repository.
For push operations, see git send-pack.
所以如果服务器不发回这种数据,我不知道如何直接提取它,除非通过查看 upload-pack.c
中的注释
/* We read from pack_objects.err to capture stderr output for
* progress bar, and pack_objects.out to capture the pack data.
*/
如果您有权访问服务器端的 pack_objects.err
,您也许能够(也许)从中获取一些信息。
关于 pull/取时 Git 进度观察,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3194322/