基于 Cloudflare Workers · 支持 git clone / push · API · Raw · Release 下载
执行以下命令,所有 github.com 的 git 操作自动走镜像,无需修改任何仓库配置:
git config --global url."https://gh.lihongjie.cn/".insteadOf "https://github.com/"
配置后 git clone https://github.com/user/repo.git 会自动重定向到镜像站。
验证配置是否生效:
git config --global --get-regexp url
如需撤销,执行:
git config --global --unset url."https://gh.lihongjie.cn/".insteadOf
| 代理路径 | 目标域名 | 用途 |
|---|---|---|
/api/* | api.github.com | GitHub REST API |
/raw/* | raw.githubusercontent.com | Raw 文件 |
/objects/* | objects.githubusercontent.com | Release 二进制 (R2 缓存) |
/codeload/* | codeload.github.com | zip / tar.gz 归档 |
/* | github.com | git clone/push · releases |