将编译器设置为代理。

设置代理,将端口号改为你自己的代理端口号

git config --global http.proxy http://127.0.0.1:10887
git config --global https.proxy http://127.0.0.1:10887

取消全局代理

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

其他命令

查看系统config

git config --system --list

查看当前用户(global)配置

git config --global  --list

查看当前仓库配置信息

git config --local  --list

提交用户的email和用户名

git config --global user.name "myname"
git config --global user.email  "test@gmail.com"

配置终端 http代理配置

配置:

export https_proxy=http://127.0.0.1:10887 http_proxy=http://127.0.0.1:10887 all_proxy=socks5://127.0.0.1:10887

取消代理:

unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY

说明:http_proxy 和 https_proxy 是小写变量,部分应用可能依赖大写变量(如 HTTP_PROXY),建议同时取消