欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

GIT 代理配置和遇到的问题-1.配置

最编程 2024-07-07 21:23:49
...
  • 配置代理
# 配置, 如果代理不需要账号密码不用配置[用户名:密码@], 如果密码有特殊字符, 使用url编码后使用, 如果代理支持https, 可以尝试使用https, 我没有用过
git config --global http.sslVerify false
git config --global http.http://gitee.com.proxy http://用户名:密码@yourproxy:port
git config --global --add http.https://gitee.com.proxy http://用户名:密码@yourproxy:port
git config --global http.http://github.com.proxy http://用户名:密码@yourproxy:port
git config --global --add http.https://github.com.proxy http://用户名:密码@yourproxy:port
  • 配置后结果文件位于: ~/.gitconfig
# 配置后配置文件如下
[http]
	sslVerify = false
[http "http://gitee.com"]
	proxy = http://用户名:密码@yourproxy:port
[http "https://gitee.com"]
	proxy = http://用户名:密码@yourproxy:port
[http "http://github.com"]
	proxy = http://用户名:密码@yourproxy:port
[http "https://github.com"]
	proxy = http://用户名:密码@yourproxy:port
  • 移除配置
# 移除配置
git config  --global --unset http.proxy
git config  --global --unset http.sslVerify
git config  --global --unset http.http://gitee.com.proxy
git config  --global --unset http.https://gitee.com.proxy
git config  --global --unset http.http://github.com.proxy
git config  --global --unset http.https://github.com.proxy

推荐阅读