配置终端代理

配置git终端代理(常用)

1
2
3
4
5
6
7
# 设置代理
git config --global http.proxy "http://127.0.0.1:10809"
git config --global https.proxy "https://127.0.0.1:10809"

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

Power shell

1
2
3
4
5
6
7
8
9
10
11
# 设置
$env:http_proxy = "http://代理服务器地址:端口"
$env:https_proxy = "http://代理服务器地址:端口"

# 查看
$env:http_proxy
$env:https_proxy

# 清除
Remove-Item Env:http_proxy
Remove-Item Env:https_proxy