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/GitHub/GitLab/Gitee 核心对比指南
git·gitlab·github
佛山个人技术开发2 小时前
GitCode个人技术开发者总结完整使用指南
windows·git·svn·github·gitcode
江华森3 小时前
基于 Git 的自动集成交付(Git-Driven CI/CD)实战
git·ci/cd
Dontla4 小时前
.gitkeep文件作用(让Git追踪空目录,使该目录能被纳入版本控制)!.gitkeep
大数据·git·elasticsearch
shandianchengzi4 小时前
【记录】VSCode|Windows 下 VS Code 配置 Git Bash 为默认终端完整教程
windows·git·vscode·bash
EleganceJiaBao4 小时前
【Git】现代开发工作流(Main + Feature Branch)
git·github
小怪不太怪~4 小时前
本地项目上传到GitHub--小怪教程(Git Bash实操+常见报错解决
git·github·bash
_codemonster15 小时前
git 容易混淆的点
git
_codemonster18 小时前
Git 最常用操作和原理
大数据·git·elasticsearch
_codemonster1 天前
.git文件夹里所有文件详解
git