在做代码开发时经常要用到GitHub,查查看下载仓库代码,在某些特殊时段或特殊网段,github都会呈现和谷歌一样的访问结果无法访问,导致无法克隆和下载GitHub代码,这里我们就要用到GitHub镜像站要下载或克隆仓库了。
这里介绍一个镜像下载站:
移动联通用户:https://mirror.ghproxy.com/
电信用户:https://ghproxy.com/
用法:粘贴github链接(code的zip 或 release中的source code和文件)
以我的github项目lightmysql为例:
code zip:https://github.com/Danny-Yxzl/lightmysql/archive/refs/heads/master.zip
release中的source code:https://github.com/Danny-Yxzl/lightmysql/archive/refs/tags/1.0.5.tar.gz
一个别的项目中的release附件:https://github.com/qishibo/AnotherRedisDesktopManager/releases/download/v1.4.9/Another-Redis-Desktop-Manager.1.4.9.exe
github的下载采用直链,如果能访问只是速度慢的话我们可以直接复制来;但是有时完全无法访问,这时候我们可以通过code下载生成链接的规律下载文件:
https://github.com/用户名/项目名/archive/refs/heads/分支名称.zip
在clone和wget等操作中也可使用该镜像:
# git clonegit clone https://mirror.ghproxy.com/https://github.com/Danny-Yxzl/lightmysql# wgetwget https://mirror.ghproxy.com/https://github.com/Danny-Yxzl/lightmysql/archive/refs/heads/master.zipwget https://mirror.ghproxy.com/https://raw.githubusercontent.com/Danny-Yxzl/lightmysql/1.0.5/lightmysql.py# curlcurl -O https://mirror.ghproxy.com/https://github.com/Danny-Yxzl/lightmysql/archive/refs/heads/master.zipcurl -O https://mirror.ghproxy.com/https://raw.githubusercontent.com/Danny-Yxzl/lightmysql/1.0.5/lightmysql.py