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
相关推荐
chenshiming8021 小时前
在cursor下执行GIT回退版本
git
打点计时器4 小时前
Git快速上手教程
git
我才是一卓5 小时前
linux 安装简易 git 服务端并使用
linux·运维·git
IDIOT___IDIOT7 小时前
关于 git 进行版本管理的时候 gitignore 写入忽略规则而不生效的问题
大数据·git·elasticsearch
不想看见4047 小时前
Git 误删急救手册
大数据·git·elasticsearch
偷懒下载原神7 小时前
【linux操作系统】信号
linux·运维·服务器·开发语言·c++·git·后端
IT二叔7 小时前
Git Flow03-发布流程
git
IT二叔7 小时前
Git Flow08-摘樱桃
git
「QT(C++)开发工程师」8 小时前
Git误操作急救手册大纲
git
贺小涛9 小时前
Git代码提交规范和踩坑排水明沟
大数据·git·elasticsearch