git 配置网络代理

提高 git 访问 github 速度

网络代理前提:

  • 请开启代理(梯子)
  • 检查代理端口(可能会有所不同)

文章目录

  • [1. git 配置参数列表命令:](#1. git 配置参数列表命令:)
  • [2. git 添加 http 代理](#2. git 添加 http 代理)
  • [3. git 取消 http 代理](#3. git 取消 http 代理)

1. git 配置参数列表命令:

bash 复制代码
git config --list

2. git 添加 http 代理

两个http 差别不大,只是增加(或减少)一个字母 s

选择下面其中一个就可以。

  1. http / https 代理

根据 http 端口设置,我这里端口为 10809

bash 复制代码
git config --global http.proxy http://127.0.0.1:10809
bash 复制代码
git config --global https.proxy https://127.0.0.1:10809
  1. socks 代理

根据 socks 端口设置,我这里端口为 10808

bash 复制代码
git config --global http.proxy 'socks5://127.0.0.1:10808'
bash 复制代码
git config --global https.proxy 'socks5://127.0.0.1:10808'

3. git 取消 http 代理

bash 复制代码
git config --global --unset http.proxy
bash 复制代码
git config --global --unset https.proxy

参考

  1. git 设置网络代理,修改http.proxy

附录

我的代理端口截图如下:

相关推荐
熙xi.1 分钟前
以太网帧格式、IP数据报头部、TCP头部、UDP头部
网络·tcp/ip·udp
盛世宏博智慧档案32 分钟前
新生产力算力机房内部温湿度之以太网监控系统方案
运维·服务器·网络·算力·温湿度
星释32 分钟前
Rust 练习册 16:Trait 作为返回类型
java·网络·rust
qyresearch_36 分钟前
全球生物识别加密U盘市场:安全需求驱动增长,技术迭代重塑格局
网络·安全
wydaicls1 小时前
C语言完成Socket通信
c语言·网络·websocket
XU磊2601 小时前
Git 实现github仓库管理-删除指定目录下的所有文件并保留目录结构
git·github
light_forest3 小时前
tcp_connect_v4接口
java·网络·tcp/ip
zhimingwen3 小时前
解决 GitLab Token 轮换后 SourceTree 认证失败问题
git
昵称是6硬币4 小时前
代码管理——VS Code|Git
git·代码管理
Matana1114 小时前
Vmware中主机ip a没有ip地址
服务器·网络·tcp/ip