github加速服务指南
前言
因公司经常有同事反馈无法访问github下载,因此找了下加速验证可行。
用于在中国大陆加速访问 GitHub,但不是我这边部署的因此不对其可靠性负责。
步骤
- 复制原始 github 仓库 clone 地址。
- 在地址前添加加速服务的域名
https://ghfast.top/
。
例如:
- 原地址:
https://github.com/redis/redis
- 代理地址:
https://ghfast.top/https://github.com/redis/redis
如果遇上被封失效,您可以访问 https://ghproxy.link/ 获取最新可用域名。
下载公共仓库
获取 https 仓库地址后,添加前缀,发起 git clone:
下载私有仓库
下载私有仓库时,无法使用基于 SSH 密钥的认证,需要使用 Github 的访问 Token。步骤如下:
- 前往 GitHub,创建 Tokens(classic) 或 Fine-grained tokens。请务必确保您创建的 Token 对需要下载的仓库至少 Read-only 权限。
-
获取私有仓库的 https 仓库地址后,添加前缀,添加您的 Github 用户名和 Token,发起 git clone:
自行部署
请参考:https://github.com/hunshcn/gh-proxy