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
相关推荐
装不满的克莱因瓶41 分钟前
【踩坑】IDEA提交Git .gitignore忽略文件不起作用
java·git·.gitignore·踩坑
cos11 小时前
Fork 主题如何更新?基于 Ink 构建主题更新 CLI 工具
前端·javascript·git
OpenMiniServer12 小时前
当 AI 成为 Git 里的一个“人”
人工智能·git
Carry34513 小时前
不清楚的 .gitignore
前端·git
番茄灭世神21 小时前
Git入门使用学习
git·gitee·软件工程·计算机专业入门
南_山无梅落1 天前
团队协作高频Git实用手册(项目实战版)
git·团队开发
就叫飞六吧1 天前
git提取当前分支指定文件历史版本
git
数字游民95271 天前
网站备案全流程回放(腾讯云)
人工智能·git·github·腾讯云·网站备案·waytoopc
Albert Edison1 天前
【Git】多人协作一(同一分支下)
git·vscode·svn·github
学好statistics和DS1 天前
Git 同步冲突
大数据·git·elasticsearch