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 小时前
博客目录框架
c语言·开发语言·arm开发·git·嵌入式硬件·神经网络·编辑器
Rabbit_QL2 小时前
【CI/CD】02_一次 git push 后发生了什么?CI 是怎么工作的
git·ci/cd
不会写DN3 小时前
Git 开发中最常用的命令与场景
大数据·git·elasticsearch
张二娃同学3 小时前
基于 Python 与 Tkinter 的猜数字游戏设计与实现:支持玩家猜数与 AI 反向推理
开发语言·git·python·游戏·开源
原来是猿3 小时前
Git【企业级开发模型】
git
bu_shuo4 小时前
git学习
git·学习
最贪吃的虎4 小时前
Mac安装Git教程
git·macos
海参崴-18 小时前
【Linux 项目自动化构建工具 -- make/makefile && 版本管理 Git 的使用&&第一个程序
linux·git·自动化
W-琑19 小时前
Git基本操作及操作原理
git
流星雨在线21 小时前
项目 Git 分支 + Tag 管理规范
git