GitHub拉取代码慢解决方案

解决方案

1.使用GitHub的镜像网站。网上可以找到的镜像地址有:

现在能用的只剩这个了,下面的不用看了
https://github.91chi.fun/https://github.com

fastgit.org
https://doc.fastgit.org/

cnpmjs.org
https://github.com.cnpmjs.org/

gitclone
https://gitclone.com/

2.设置git config(设置的是用户配置文件:~/.gitconfig):

git config --global http.postbuffer 1048576000
git config --global http.sslVerify false
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

PS:第二种方法我测试了基本没用。

使用镜像地址替换GitHub的方式

方法一:将github.com替换为镜像地址(推荐使用fastgit)

#原命令
git clone https://github.com/huaweicloud/huaweicloud-sdk-java-v3.git

#github.91chi.fun
https://github.91chi.fun/https://github.com/huaweicloud/huaweicloud-sdk-java-v3.git

#github.com.cnpmjs.org
git clone https://github.com.cnpmjs.org/huaweicloud/huaweicloud-sdk-java-v3.git

#hub.fastgit.org
git clone https://hub.fastgit.org/huaweicloud/huaweicloud-sdk-java-v3.git

#gitclone
https://gitclone.com/github.com/huaweicloud/huaweicloud-sdk-java-v3.git

方法二:修改配置文件

git config --global url."https://github.91chi.fun/https://github.com".insteadOf https://github.com

或直接修改~/.gitconfig文件:

[url "https://hub.fastgit.org/"]
 insteadOf = https://github.com/

PS:以上配置仅对HTTPS有效,SSH时需要将代理取消:

git config --global --unset url.https://github.com/.insteadof

参考

https://note.qidong.name/2020/12/github-proxy/
https://blog.csdn.net/networken/article/details/105122778

  • 5
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值