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
相关推荐
等等,要下雨17 小时前
git常用命令
git
一直在学习的小白~1 天前
Sourcetree安装使用的详细教程
git
陈苏同学1 天前
从 Git 到 GitHub - 使用 Git 进行版本控制 - Git 常用命令
git·github
影子24012 天前
git项目迁移,包括所有的提交记录和分支 gitlab迁移到gitblit
git·gitlab·git迁移
laimaxgg2 天前
Git撤销修改
git
象骑士Hack2 天前
Xterminal(或 X Terminal)通常指一类现代化的终端工具 工具介绍
git
新时代牛马2 天前
git处理浅克隆
git
学习2年半2 天前
git相关
git
极小狐2 天前
如何减少极狐GitLab 容器镜像库存储?
运维·git·rpc·kubernetes·ssh·gitlab·terraform
C.er2 天前
Git回顾
git