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 submodule
git
A-Jie-Y3 小时前
Git基础-核心概念与常用命令
git
夜珀4 小时前
Git基础修炼手册:在AtomGit上玩转版本控制
git
golang学习记4 小时前
Zed IDE官宣新招:Git Graph 正式支持!
ide·git
要记得喝水4 小时前
适用于 Git Bash 的脚本,批量提交和推送多个仓库的修改
git·elasticsearch·bash
AI_Claude_code5 小时前
专栏导论:开源项目贡献的价值与Git工作流全景图
git·开源
never forget shyang5 小时前
CCS20.2.0使用教程
c语言·git·单片机
lifewange14 小时前
常用的Git命令有哪些?
git
无限进步_15 小时前
【C++】电话号码的字母组合:从有限处理到通用解法
开发语言·c++·ide·windows·git·github·visual studio
C++ 老炮儿的技术栈15 小时前
GCC编译时无法向/tmp 目录写入临时汇编文件,因为设备空间不足,解决
linux·运维·开发语言·汇编·c++·git·qt