git 从 GitHub 下载非常慢

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29634139/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:04:45  来源:igfitidea点击:

Very slow download from GitHub

gitgithub

提问by ooxi

When cloning a repository from GitHub I sometimes only get a download rate between 50-100 KiB/sec (staying stable) while most of the time I have about 10 MiB/sec. When cloning the same repository from a different machine (= different global IP) I get full speed.

从 GitHub 克隆存储库时,我有时只能获得 50-100 KiB/秒(保持稳定)之间的下载速率,而大部分时间我的下载速率约为 10 MiB/秒。当从不同的机器(= 不同的全局 IP)克隆同一个存储库时,我得到了全速。

Does GitHub impose a rate limit on repository cloning? The repository in question is quite big (~100 MiB) and I clone it about twice a day.

GitHub 是否对存储库克隆施加了速率限制?有问题的存储库非常大(~100 MiB),我每天克隆它大约两次。

采纳答案by Joe Atzberger

Do you have massive binaries committed in the repos? That might do it.

你在 repos 中提交了大量的二进制文件吗?那可能就行了。

Otherwise, look at optimizing your CI's behavior. Instead of:

否则,请查看优化 CI 的行为。代替:

git submodule update [--recursive]

You want:

你要:

git submodule update [--recursive] --depth 1

CI doesn't need the whole repo history, just the target state. More details here: Git shallow submodules

CI 不需要整个 repo 历史,只需要目标状态。更多细节在这里:Git 浅子模块

回答by Sabir Ali

Was having the same issue both at office and home, two different IPs. Just restarted my machine and download speed is back to normal.

在办公室和家里都有同样的问题,两个不同的 IP。刚刚重新启动我的机器,下载速度恢复正常。