git 拉取github项目失败(超时)

问题

通过git拉取GitHub上的项目失败报错信息如下

fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

原因:因为拉取的项目过大导致失败

解决

1.利用镜像网站
将链接中的 github.com 替换为 github.com.cnpmjs.org

如果方法1报以下错误

Could not resolve host: github.com.cnpmjs.org

在git控制台上输入下面这句,然后在正常去拉取,它会使你默认使用镜像

git config --global url."https://hub.fastgit.xyz/".insteadOf https://github.com/
2.拉取最近提交的一次提交,然后再拉取全部
git clone --depth 1 [链接]
git fetch --unshallow
3.延长克隆的时间
git config --global http.postBuffer 600000
4.通过将github项目导入码云,然后再拉取
posted @   太阳是白的  阅读(5800)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示