git 网络问题, git代理设置,git clone 速度限制, 以及 vmware环境网络问题

博客原文

文章目录

    • 前言
    • [Git 代理](#Git 代理)
      • 问题分析:
      • [v-two-ray 演示:](#v-two-ray 演示:)
      • [设置 git 代理](#设置 git 代理)
      • [取消 git 代理](#取消 git 代理)

前言

相信计算机专业的同学在学习 linux 时, 一定会被无法获取网络资源而困惑, 本文带你打通 git clone 的速度限制

Git 代理

问题分析:

  • 本机已经打开代理但是 git clone 依然很慢
  • git push 时, 超时无法推送
  • 解决git报错:ssh:connect to host github.com port 22: Connection timed out

v-two-ray 演示:

开启局域网连接

v-two-ray 端口地址:

我们知道的 v-two-ray 的端口, 这里我们要用本地端口, 因为我们是主机的 git

设置 git 代理

sh 复制代码
git config --global http.proxy http://127.0.0.1:10809
git config --global https.proxy https://127.0.0.1:10809

取消 git 代理

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

如果是虚拟机的话, 需要将地址设为网关地址

另外如果是 VMware 虚拟机:

sh 复制代码
$ ip r
default via 192.168.254.2 dev ens33 proto static
192.168.254.0/24 dev ens33 proto kernel scope link src 192.168.254.130

虚拟机网关为 192.168.254.2, 但该网关为虚拟网关不接流量, 应使用 192.168.254.1

sh 复制代码
git config --global http.proxy http://192.168.254.1:10809
git config --global https.proxy https://192.168.254.1:10809
相关推荐
Winlifes11 小时前
我给 Codex 做了一个 Git 面板:分支树、提交历史和工作区操作
git
虎头金猫11 小时前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
AI职业加油站13 小时前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
wuyk55513 小时前
《WiFi 嵌入式物联网开发全套实战》| 第 16 章 ESP32 AP+STA 双模共存原理与工程坑点
网络·stm32·物联网
lpfasd12313 小时前
2026年第38周GitHub趋势周报
python·科技·github
此冬歌咏13 小时前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
u13013014 小时前
GitHub 热榜项目:日榜(2026-09-21)
人工智能·github
-梅14 小时前
linux(8) 软硬链接
linux·运维·服务器
张洛闻Eren15 小时前
k8s云原生【第十课】:水平 Pod 自动扩缩容
运维·数据库·云原生·kubernetes·github
其实防守也摸鱼15 小时前
内网穿透与反向代理:原理、工具与实战指南
android·大数据·运维·安全·网络安全·自动化·渗透