当前位置:   article > 正文

github 续传和加速_ghproxy

ghproxy

一、Clone时 中断后怎么续传

很多人都会…

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

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

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

二、clone 加速:

  1. ipaddress查询域名对应的 IP 地址
199.232.69.194   github.global.ssl.fastly.net
140.82.114.3     github.com
  • 1
  • 2
  1. 修改host文件
windows  : C:\Windows\System32\drivers\etc\hosts
linux/MAC: /etc/hosts
  • 1
  • 2
  1. 刷新DNS
windows:  ipconfig /flushdns
linux  :  yum install -y nscd  &&  systemctl restart nscd
MacOS  :  sudo killall -HUP mDNSResponder
  • 1
  • 2
  • 3
  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
  • 1
  • 2
  • 3
  • 4

三、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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/847619
推荐阅读
相关标签
  

闽ICP备14008679号