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
相关推荐
千寻girling1 天前
五一劳动节快乐 [特殊字符][特殊字符][特殊字符]
java·c++·git·python·学习·github·php
波特率1152001 天前
git指令学习
git·学习
Karry_6661 天前
[特殊字符] Git 提交项目 全套命令(按顺序执行)
git
计算机安禾1 天前
【Linux从入门到精通】第39篇:版本控制Git服务器搭建——Gitea/GitLab私有化部署
linux·服务器·git
lst04261 天前
Git 巨大失误案例记录 (2026-05-01)
大数据·git·elasticsearch
donecoding1 天前
Git Worktree:一个仓库同时在多个分支工作,告别 stash 地狱
git
Shadow(⊙o⊙)1 天前
git辅助工具
git
Yang-Never1 天前
Git -> Git Worktree 工作树
android·开发语言·git·android studio
hashiqimiya1 天前
一次git合并与上传
git
独隅1 天前
it+云原生:GitOps实践指南-K8s配置版本管理
git·elasticsearch·云原生