GitHub Git Clone 代理服务

通过Cloudflare Workers加速GitHub仓库的克隆和访问

1如何使用

将GitHub仓库URL中的 github.com 替换为代理地址即可:

原始URL: https://github.com/username/repository.git
代理URL: https://git.onwz.dpdns.org/username/repository.git

2Git Clone 示例

# 原始命令 git clone https://github.com/username/repository.git # 使用代理 git clone https://git.onwz.dpdns.org/username/repository.git
实际示例:
git clone https://git.onwz.dpdns.org/torvalds/linux.git

3现有仓库修改远程地址

如果已存在的仓库需要切换为代理地址:

# 查看当前远程地址 git remote -v # 修改远程地址 git remote set-url origin https://git.onwz.dpdns.org/username/repository.git # 验证修改 git remote -v
⚠️ 注意事项:

4支持的Git操作

5自定义配置

如需修改配置,编辑Worker代码中的 config 对象:

// 修改GitHub镜像源(如使用国内镜像) githubHost: 'github.com.cnpmjs.org' // 设置允许的域名 allowedOrigins: ['https://yourdomain.com'] // 修改缓存时间 cache: { staticTTL: 86400, // 静态资源缓存24小时 apiTTL: 300 // API响应缓存5分钟 }