github 续传和加速

一、Clone时 中断后怎么续传

很多人都会…

git clone https://github.com/xxx/xxx.git

对于大文件, 下载速度很鸡肋时, 很少人会…

#断点续传 --recursive
git clone --recursive  https://github.com/xxx/xxx.git

二、clone 加速:

  1. ipaddress查询域名对应的 IP 地址
199.232.69.194   github.global.ssl.fastly.net
140.82.114.3     github.com
  1. 修改host文件
windows  : C:\Windows\System32\drivers\etc\hosts
linux/MAC: /etc/hosts
  1. 刷新DNS
windows:  ipconfig /flushdns
linux  :  yum install -y nscd  &&  systemctl restart nscd
MacOS  :  sudo killall -HUP mDNSResponder
  1. git clone --recursive xxxxxxxxxxxx
#加速前
接收对象中:  10% (12/112), 516.01 KiB | 19.00 KiB/s
#加速后,提速明显
接收对象中:  10% (12/112), 5.27 MiB | 483.00 KiB/s

三、gh-proxy 代理下载

git config --global url.“https://gitclone.com/github.com”.insteadOf “https://github.com”

gh-proxy 是一款 github release、archive以及项目文件的加速项目,支持直接在终端 git clone ,也可以在 web 端代理下载 github 以及 raw.githubusercontent.com 等文件.

在国内网络环境下使用 GitHub 相关服务体验很差,其域名github.com和仓库文件直链域名raw.githubusercontent.com被 DNS 污染,除了修改 hosts 解决以外,还可以使用gh-proxy来代理访问.

项目默认使用 jsdelivr 和 cnpmjs 镜像

使用: 仅需在直链之前加上 https://ghproxy.com 即可
代理加速: git clone https://ghproxy.com/https://github.com/xxx/xxx.git
gh-proxy 代理

参考: https://github.com/hunshcn/gh-proxy

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值