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 - 版本控制工具 - 对应的常见命令 - 以及无需后续每次手动source conda
git
changxiang3 小时前
GIT 备忘
git
DogDaoDao11 小时前
Windows 开发提效工具全景指南:60+ 工具的工程化分层配置
windows·git·程序员·开发工具·powershell·everything·msys2
wdfk_prog21 小时前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github
大明二代1 天前
使用 Traefik、cert-manager 和 DNS-01 为内网 Kubernetes 服务配置 HTTPS
git·kubernetes·flux
小芒果_011 天前
git常用命令速查
大数据·git·elasticsearch
2501_930472441 天前
腾讯云助手规范化Git提交记录
git·elasticsearch·腾讯云
风尘小子2 天前
git的.gitignore文件中文件和目录配置
git
Tanner_SL2 天前
Linux笔记之GIT常用命令
linux·git
醉颜凉2 天前
Jenkins与Git集成完全指南:从基础配置到自动触发构建
运维·git·jenkins