为什么国内开发者需要飞鸟云 GitHub 镜像加速?
在国内由于公网国际出口拥堵及 DNS 污染影响,访问 github.com 常出现页面白屏、图片不加载、git clone 速率仅数十 KB/s 甚至直接抛出 Connection reset by peer 错误。飞鸟云针对开发者的这一硬需求,通过物理 IPLC 专线搭建了反向代理镜像与全局透明加速隧道。
方案一:Git 命令行终端代理配置(推荐)
在开启飞鸟云客户端后,只需在终端中为 Git 配置本地 HTTP/SOCKS5 代理端口(以 7890 端口为例):
Bash / PowerShell
# 为全局 Git 仓库配置飞鸟云专线代理
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
# 测试克隆速度(秒级下载大体积仓库)
git clone https://github.com/torvalds/linux.git
如需取消全局代理,可执行:git config --global --unset http.proxy 和 git config --global --unset https.proxy
方案二:SSH 方式快速克隆配置 (Config)
若习惯使用 [email protected]:user/repo.git 方式,可修改 ~/.ssh/config 文件注入 Connect 代理指令:
~/.ssh/config
Host github.com
User git
# Windows 用户使用 connect 代理(Git 自带)
ProxyCommand connect -H 127.0.0.1:7890 %h %p
# macOS/Linux 用户可使用 nc 代理:
# ProxyCommand nc -X 5 -x 127.0.0.1:7890 %h %p