Git 配置代理

Sep 06, 2024 · 368 字
Linux

Git 不会自动从终端代理设置中读取代理信息,所以需要手动配置代理。

git config --global http.proxy proxy_url
git config --global https.proxy proxy_url

如果只需要临时使用代理,使用参数指定代理地址:

git clone repo_url -c http.proxy=proxy_url

此外,还可以尝试使用镜像仓库服务,例如对于 https://github.com/example/repo.git,可以使用以下命令:

git clone https://mirror.ghproxy.com/https://github.com/example/repo.git

粤公网安备44030002006951号 粤ICP备2025414119号

© 2025 Saurlax · Powered by Astro