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工作流程与常用指令——从本地开发到远程协作
大数据·git·elasticsearch
FEF前端团队2 小时前
开发知识库 #01:Git 全面操作教程
git·github
weixin_531651816 小时前
Git 操作指南
大数据·git·elasticsearch
一个程序猿老马8 小时前
003、Git核心概念:仓库、工作区、暂存区、版本库
大数据·git·elasticsearch
披着羊皮不是狼9 小时前
Git完整学习总结
git·学习·elasticsearch
DevilSeagull9 小时前
MySQL(1) 安装与配置
java·数据库·git·mysql·http·开源·github
一个程序猿老马9 小时前
005、Git三板斧(1):git add - 将文件纳入版本管理
大数据·git·elasticsearch
Cyber4K9 小时前
【DevOps专项】Git 部署及使用方法
运维·git·devops
无限进步_10 小时前
二叉树的前序遍历(非递归实现)
开发语言·数据结构·c++·windows·git·visual studio
C++ 老炮儿的技术栈10 小时前
工业视觉检测:用 C++ 和 Snap7 库快速读写西门子 S7-1200
c语言·c++·git·qt·系统架构·visual studio·snap