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
相关推荐
xiaok3 小时前
分支管理提交代码
git·gitlab·github
谢尔登5 小时前
【Git】merge 分类
git
NiKo_W5 小时前
Git 版本回退与撤销修改
开发语言·git·安全
渣渣小码21 小时前
GIT客户端配置支持中文
git·git中文显示
鄃鳕21 小时前
Git 拒绝 pull,本地有未提交的修改
git
Leslie_Lei1 天前
【Eclipse】eclipse打开git拉取的项目
java·git·eclipse
渣渣小码1 天前
GIT快速上手(常用指令)
git
会豪2 天前
Git命令-图解-小白专享
git
韦禾水2 天前
IntelliJ IDEA 2023更新git凭据
git·intellij idea
Yvonne爱编码2 天前
构建高效协作的桥梁:前后端衔接实践与接口文档规范详解
前端·git·ajax·webpack·node.js