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
相关推荐
xiaocainiao88136 分钟前
Python 实战:构建 Git 自动化助手
git·python·自动化
Casia_Dominic13 小时前
【三维重建工具】NeRFStudio、3D GaussianSplatting、Colmap安装与使用指南
git·3d·github·点云
构建的乐趣13 小时前
运行ssh -T git@github.com报错
git·ssh·github
落雪小轩韩1 天前
Git 常用操作与注意事项全攻略
大数据·git
winds~1 天前
【Git】git的回退功能
大数据·git·elasticsearch
Ring__Rain1 天前
git fetch的使用
git
b1ng1 天前
新人程序员 Git 一站式指南
git·github
程序员的世界你不懂1 天前
IDE 关联 Git 操作
ide·git
weixin_428498492 天前
Git Submodule 介绍和使用指南
git
jingshaoqi_ccc2 天前
GitKraken最后一个免费版本和下载地址
git·github·gitkraken·版本管理工具