git 代理设置向导
git 支持多种代理方式,为了方便用户快速配置,本工具通过交互式向导,帮助你快速生成 git 代理配置命令。原理与详细说明请参阅代理配置教程。
操作系统
Git 协议
代理范围
代理参数
请根据你使用的客户端的实际情况填写,常见端口:
仅代理 GitHub
执行命令请在终端(Terminal / Git Bash)中执行以下命令:
git config --global http.https://github.com.proxy http://127.0.0.1:1080若需取消代理,在终端中执行以下命令:
git config --global --unset http.https://github.com.proxy推荐配置:只对 github.com 域名生效,国内仓库仍直连。
本工具仅用于生成 Git 代理配置命令,本身不提供代理服务。如需镜像加速服务请访问此工具
如果你更习惯在终端中直接操作,可直接使用git config命令管理代理配置。
git config --global http.https://github.com.proxy http://127.0.0.1:7890- 仅为 GitHub 设置代理(推荐,国内仓库仍直连)
git config --global --unset http.https://github.com.proxy- 取消针对 GitHub 的专有代理配置
git config --global http.proxy http://127.0.0.1:7890- 设置全局 HTTP 代理(所有远程仓库均走代理)
git config --global --unset http.proxy- 取消全局 HTTP 代理配置
git config --global --get http.proxy- 查看当前生效的全局代理地址
git config -l --show-origin- 查看所有生效的 Git 配置及其来源文件