Git设置代理服务器

方式一

  • 如果说使用的是项目http或者https地址,就配置http与https代理即可,输入以下命令:
shell 复制代码
git config --global http.proxy "socks5://127.0.0.1:1080"
git config --global https.proxy "socks5://127.0.0.1:1080"

这样使用git clone/push/pull所有http或者https地址项目都会走代理。

  • 还可以使用下面命令取消代理设置:
shell 复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy

方式二

  • 在.git中的config文件中增加
shell 复制代码
[http]
    proxy = http://127.0.0.1:1080
[https]
    proxy = http://127.0.0.1:1080
相关推荐
wjs04010 分钟前
Git常用的命令
java·git·gitlab
原野风霜32425 分钟前
Git使用总结
git
青草地溪水旁41 分钟前
Git Bash 中 Git 命令的实用主义指南
git·bash
至善迎风2 小时前
版本管理系统与平台(权威资料核对、深入解析、行业选型与国产平台补充)
git·gitee·gitlab·github·svm
上单带刀不带妹6 小时前
Git rm 命令与系统 rm 命令的区别详解
git
我的收藏手册10 小时前
性能监控shell脚本编写
前端·git·github
Yvonne爱编码11 小时前
简述ajax、node.js、webpack、git
前端·git·ajax·webpack·node.js·visual studio
2501_920047031 天前
git在Linux中的使用
linux·git·elasticsearch
小马哥编程1 天前
DNS解析中的服务器协作机制
服务器·git·github
白帽小野1 天前
SVN和Git两种版本管理系统对比
git·svn·版本控制系统