-
将仓库地址中的 github.com 替换为本代理域名即可加速 clone 和 pull。
-
新建仓库克隆:
git clone https://git.megumi.eu.org/github.com/owner/repo.git
-
已有仓库修改 remote 地址:
git remote set-url origin https://git.megumi.eu.org/github.com/owner/repo.git
-
Push 使用 HTTPS 协议,需配置 Personal Access Token (PAT) 进行认证。
-
前往 GitHub Settings > Developer settings > Personal access tokens 生成 Token,勾选 repo 权限。
-
配置 Git 凭据管理(推荐,仅需一次):
git config --global credential.helper store
-
执行 push 时,输入用户名和 Token 作为密码。凭据会被保存,后续无需重复输入。
安全提示:Token 等同于密码,请勿泄露。建议使用 fine-grained token 并限制仓库范围和权限。
本代理仅支持 HTTPS 协议的 Git 操作,不支持 git@github.com:... 格式的 SSH 地址。
如您当前使用 SSH remote,请通过以下命令切换为 HTTPS:
git remote set-url origin https://github.com/owner/repo.git
然后再将域名替换为本代理地址即可。
提示:SSH 走独立的 TCP 通道,HTTP 代理无法转发。切换为 HTTPS + Token 认证是更通用的方案。