pull/取时 Git 进度观察

标签 git git-fetch

这是我的问题:

当我对一些大型存储库进行 pull/获取时,我想在控制台以外的其他地方显示进度(例如在网站上) 我知道在 git 1.7.1.1 中有选项 --progress 但我不能使用这个版本并且必须留在 1.6.0.4

有没有人知道如何查看 git fetch/pull 进度(例如如何提取当前下载百分比)

最佳答案

我不确定如何做到这一点,因为 --progress 选项已在 upload-pack.c

中实现

git upload-pack mentions

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 the git 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/

相关文章:

git fetch 指定前缀的分支

git - 很难理解 git-fetch

git - 如何维护 git 中的私有(private)更改?

git - 如何从 GitHub 克隆项目但使用 Bitbucket 作为远程存储库

Git merge after fetch - 究竟如何?

git fetch 与 git fetch origin master 对跟踪分支有不同的影响

git - 仅获取 git 远程存储库的标签/引用

混帐流 : bugfixing an upcoming release

git - 在不同的分支开发功能,但处理累积的代码更改?

git 子树推送和拆分添加 "-n<newline>"以提交消息