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
相关推荐
念一不念二2 小时前
[Git]git仓库管理的使用
git
HZ·湘怡2 小时前
Gitee 手把手
git·gitee
A懿轩A2 小时前
【2026 最新】下载安装 Git 详细教程 (Windows)
git
@_@ prince @_@2 小时前
Git 命令大全(带详细说明)
git·gitee·github·visual studio
念一不念二3 小时前
【Git】命令行使用操作
git
念一不念二4 小时前
【vscode】Git的中好用的命令和技巧
git
带娃的IT创业者15 小时前
Git commands I run before reading any code
git·开发工具·版本控制·编程技巧·代码审查
九成宫16 小时前
Git 与远程仓库实操记录:克隆、配置、分支推送与问题排查
笔记·git·ssh
武超杰1 天前
Git 从入门到精通教程
git