129,248
社区成员




一、GitHub 镜像访问
国内最常用的镜像地址:
二、仓库克隆下载
1、git clone https://github.com/docker/compose.git
改为
git clone https://github.com.cnpmjs.org/docker/compose.git
或者
git clone https://hub.fastgit.org/docker/compose.git
或者
git clone https://gitclone.com/github.com/docker/compose.git
三、Release下载加速
wget https://github.com/golang/go/archive/go1.15.7.tar.gz
改为
wget https://hub.fastgit.org/golang/go/archive/go1.15.7.tar.gz
四、免替换法
git config --global url."https://hub.fastgit.org".insteadOf https://github.com
#或直接编辑 ~/.gitconfig 添加:
[url "https://hub.fastgit.org/"]
insteadOf = https://github.com/
#验证,查看git配置信息
git config --global --list
#取消配置
git config --global --unset url."https://hub.fastgit.org.insteadof"
五、raw文件下载加速
即将 raw.githubusercontent.com 替换为 raw.staticdn.net 即可加速。
wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/README.md
替换为
wget https://raw.staticdn.net/kubernetes/kubernetes/master/README.md
六、修改HOSTS文件进行加速
通过 ipaddress.com 查询:github.global.ssl.fastly.net或github.com
windows系统中修改C:\Windows\System32\drivers\etc\hosts文件的权限,指定可写入;
Linux系统中修改/etc/hosts文件;用编辑器打开hosts文件,在末尾处添加以下内容:
199.232.69.194 github.global.ssl.fastly.net
140.82.112.4 github.com
同时也可以查询其他域名地址,解决DNS污染问题。
windows中若遇到网络异常,可能是DNS缓存的问题,可以命令刷新。
ipconfig /displaydns # 显示dns缓存
ipconfig /flushdns # 刷新DNS记录
ipconfig /renew # 重请从DHCP服务器获得IP
Linux中重启网络:sudo /etc/init.d/networking restart
七、通过 Gitee 导入Github仓库进行中转下载
访问 gitee 并登录,在顶部选择“从 GitHub/GitLab 导入仓库”。
导入后,若源站更新,Gitee导入仓库需要强制更新同步。
八、GitHub 文件加速
利用 Cloudflare Workers提供GitHub 文件 , Releases , archive 以及 raw.githubusercontent.com 文件加速下载服务。
开源项目地址: https://github.com/hunshcn/gh-proxy
部署独立地址: https://ghproxy.com/
九、GitHub + Jsdelivr CDN加速(已失效)
jsDelivr 是一个免费开源的CDN 解决方案;
包含 JavaScript 库、jQuery 插件、CSS 框架、字体等常用的静态资源;
jsdelivr 不能获取 exe 文件以及 Release 处附加的 exe 和 dmg 文件。
格式为:https://cdn.jsdelivr.net/gh/<用户名>/<仓库名>/<文件及路径>
例如:GitHub
https://github.com/qimage/pub/blob/main/avatar.webp
转成 jsdelivr:https://cdn.jsdelivr.net/gh/qimage/pub/avatar.webp
用国内的cdn来建立vpn可行吗?安全性如何?有朋友推荐用腾讯云的服务,不知道好不好