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
相关推荐
行者-全栈开发15 分钟前
容器化时代来临 - Docker 技术演进与核心价值
运维·docker·容器·cicd·自动化构建·容器化时代
云飞云共享云桌面20 分钟前
非标自动化研发成本高?云飞云共享云桌面:1台主机=10台工作站,年省数十万。
大数据·运维·服务器·人工智能·自动化·云计算·电脑
chehaoman1 小时前
Failed to restart nginx.service Unit nginx.service not found
运维·nginx
Linux运维技术栈1 小时前
生产环境Linux应用目录迁移至LVM独立分区 标准化实战方案
linux·运维·服务器·lvm·逻辑卷
tang777891 小时前
小红书平台用什么代理 IP 比较好?2026年3月实测数据 + 选型推荐
网络·爬虫·python·网络协议·tcp/ip·数据挖掘·ip
feasibility.2 小时前
SSH Agent Forwarding 与 tmux 排障笔记
linux·运维·服务器·经验分享·笔记·ssh
ShawnLiaoking2 小时前
Linux 会话窗口常开
linux·运维·服务器
CDN3602 小时前
中小团队加速 + 防护方案:360CDN+SDK 游戏盾实测
运维·游戏·网络安全
wheelmouse77883 小时前
网络排查基础与实战指南:Ping 与 Telnet
开发语言·网络·php
今晚务必早点睡3 小时前
Nginx 从入门到精通:一篇讲透原理、功能、配置与实战场景
运维·nginx·负载均衡