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

附录

我的代理端口截图如下:

相关推荐
用户47861297206927 小时前
Git:如何排查非线性历史中被隐秘覆盖的修改(完整实战笔记)
git
xixixi777778 小时前
解析一下传输安全——“它是什么”,更是关于“它为何存在”、“如何实现”以及“面临何种挑战与未来”
网络·安全·通信
jerryinwuhan10 小时前
socket由浅入深
网络
weixin_3776348410 小时前
【Git使用】PyCharm中的Git使用
ide·git·pycharm
xu_yule11 小时前
网络和Linux网络-3(套接字编程)TCP网络通信代码
linux·网络·tcp/ip
爱吃泡芙的小白白12 小时前
vscode、anaconda、git、python配置安装(自用)
ide·git·vscode·python·anaconda·学习记录
喜欢吃豆13 小时前
使用 OpenAI Responses API 构建生产级应用的终极指南—— 状态、流式、异步与文件处理
网络·人工智能·自然语言处理·大模型
xixixi7777713 小时前
解析一下存储安全——“它是什么”,更是关于“它为何存在”、“如何实现”以及“面临何种挑战与未来”
网络·安全·通信
运维有小邓@13 小时前
实时日志关联分析工具:智能检测潜在安全威胁
运维·网络·安全
j***576814 小时前
电脑可以连接wifi,但是连接后仍然显示没有网络
网络·电脑·php