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
相关推荐
不吃鱼的羊1 天前
git推送提示错误missing Change-Id in message footer
git
小霍同学2 天前
Git 常用指令汇总
git
无限进步_2 天前
深入解析list:一个完整的C++双向链表实现
开发语言·c++·git·链表·github·list·visual studio
Awna2 天前
Git 合并多次提交记录实战
git
火车叼位2 天前
一次看懂 Git 仓库分叉、冲突已解决但仍在合并中的状态
git
ruanCat2 天前
simple-git-hooks 踩坑实录:钩子装对了却从没触发过,原来是 .git 目录捣的鬼
前端·git·代码规范
葱卤山猪2 天前
Git常用核心命令实操总结(新手避坑版)
大数据·git·elasticsearch
深蓝轨迹2 天前
Git误操作急救手册
chrome·git·elasticsearch
无限进步_2 天前
【C++】字符串中的字母反转算法详解
开发语言·c++·ide·git·算法·github·visual studio
Tipriest_2 天前
git reflog介绍(找回之前detach后做的commit)
git