Featured image of post git设置代理

git设置代理

git设置、取消代理

添加代理

1
2
3
4
5
6
7
//http || https
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890

//sock5代理
git config --global http.proxy socks5://127.0.0.1:7891
git config --global http.proxy socks5://127.0.0.1:7891

只针对github配置代理

1
2
3
4
5
6
7
8
#使用socks5代理(推荐)
git config --global http.https://github.com.proxy socks5://127.0.0.1:7890
#使用http代理(不推荐)
git config --global http.https://github.com.proxy http://127.0.0.1:7890
#取消socks5代理
git config --global --unset http.https://github.com.proxy
#取消http代理
git config --global --unset http.https://github.com.proxy

查看代理

1
2
git config --global --get http.proxy
git config --global --get https.proxy

取消代理

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

clash for windows 代理

clash for windows 的 http 和 socks5 代理使用的是同一个端口。

参考:
https://blog.csdn.net/weimeibuqieryu/article/details/106793645 https://github.com/Fndroid/clash_for_windows_pkg/issues/1244

Licensed under CC BY-NC-SA 4.0
Built with Hugo
主题 StackJimmy 设计