Git 代理配置指南
解决国内访问 GitHub 不稳定的问题。
快速开始
配置方案
方案 1: ghproxy(推荐用于 Git 操作)
适用于自建 ghproxy 服务器的用户。
# 配置代理
./scripts/git-proxy-setup.sh setup-ghproxy http://your-server:port
# 示例
./scripts/git-proxy-setup.sh setup-ghproxy http://localhost:8080
方案 2: Cloudflare Workers(推荐用于 Raw 文件)
适用于使用 CF Workers 部署代理的用户。
方案 3: 混合策略(推荐)
Git 操作走 ghproxy,Raw 文件走 CF Workers。
./scripts/git-proxy-setup.sh setup-hybrid \
http://your-ghproxy:port \
https://your-worker.workers.dev
常用命令
# 查看当前状态
./scripts/git-proxy-setup.sh status
# 测试 GitHub 连接
./scripts/git-proxy-setup.sh test-connection
# 清除所有代理配置
./scripts/git-proxy-setup.sh clear
代理部署参考
ghproxy 部署
Cloudflare Workers 部署
故障排除
连接失败
- 检查代理服务器是否正常运行
- 检查防火墙设置
- 尝试切换代理方案