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
相关推荐
SNOWPIAOP25 分钟前
git status 出现中文乱码的解决方案等
git·乱码·postgres
qq_4352879211 小时前
第9章 夸父逐日与后羿射日:死循环与进程终止?十个太阳同时值班的并行冲突
java·开发语言·git·死循环·进程终止·并行冲突·夸父逐日
AIMath~18 小时前
Git 子模块(Submodule)目录结构清除实战复盘
git
切糕师学AI19 小时前
Ubuntu 下 Git 完全使用指南
linux·git·ubuntu
一袋米扛几楼9820 小时前
【Git】规范化协作:详解 GitHub 工作流中的 Issue、Branch 与 Pull Request 最佳实践
前端·git·github·issue
尘埃落定wf21 小时前
# GitHub CLI:告别繁琐的 Git 命令,让开发更高效
git·github
恋喵大鲤鱼21 小时前
git clone
git·git clone
金牛IT1 天前
Gogs 轻量级 Git 服务器搭建与使用
运维·服务器·git
Qres8211 天前
Git安装记录
git
wj3055853781 天前
Codex + Git 开发环境配置指南(WSL版)
linux·运维·git