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

附录

我的代理端口截图如下:

相关推荐
落雪小轩韩2 小时前
Git 常用操作与注意事项全攻略
大数据·git
winds~2 小时前
【Git】git的回退功能
大数据·git·elasticsearch
Ring__Rain2 小时前
git fetch的使用
git
nightunderblackcat2 小时前
新手向:Python网络编程,搭建简易HTTP服务器
网络·python·http
cui_win3 小时前
【网络】Linux 内核优化实战 - net.ipv4.tcp_congestion_control
linux·网络·tcp/ip
roboko_3 小时前
TCP详解——流量控制、滑动窗口
服务器·网络·tcp/ip
长弓三石5 小时前
鸿蒙网络编程系列57-仓颉版固定包头可变包体解决TCP粘包问题
网络·tcp/ip·harmonyos
FileLink跨网文件交换5 小时前
跨网文件交换?内外网文件交换十大方法构建安全合规的数据传输通道
运维·服务器·网络
️️(^~^)5 小时前
静态路由综合配置实验报告
服务器·网络·计算机网络·智能路由器
Andy杨6 小时前
20250710-2-Kubernetes 集群部署、配置和验证-网络组件存在的意义?_笔记
网络·笔记·kubernetes