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
相关推荐
吹牛不交税3 小时前
visualstudio把项目绑定git仓库
git
c238563 小时前
git常见错误和ssh验证推送
运维·git·ssh
火山上的企鹅3 小时前
Codex实战:APP远程升级服务搭建(四)Node 服务端自动识别 APK 信息
android·服务器·git·github·qgc
徐子元竟然被占了!!7 小时前
Git学习
git·学习·elasticsearch
l1o3v1e4ding8 小时前
windows安装Claude Code,并接入Deepseek-v4模型 ,提供离线安装包
git·npm·node.js·claude code·cc-switchcc
Dontla19 小时前
git bash打开Claude code报错:Claude Code on Windows requires git-bash.(别把git装其他位置,严格按照默认安装)找不到claude code
windows·git·bash
一个梦醒了19 小时前
安装git bash选项推荐
开发语言·git·bash
呆萌的代Ma1 天前
Git不强行推送,撤销最近几次的提交
git
透明的玻璃杯1 天前
git应用
git
炸炸鱼.1 天前
Git+Jenkins实战(一):从零搭建自动化发布与回滚系统(附完整代码)
git·jenkins