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
相关推荐
云边云科技_云网融合12 小时前
AI 时代组网新范式:零信任软件定义组网,让连接更安全更灵活
网络·安全
简单点了12 小时前
全栈编程基础知识7
运维·服务器·网络
眷蓝天13 小时前
Docker 镜像瘦身:从 GB 到 MB 的优化实践
运维·docker·容器
实心儿儿13 小时前
Linux —— 进程控制 - mini shell
linux·运维·服务器
房开民13 小时前
modbus相关学习
网络·学习
程序员黄老师13 小时前
Windows文件移动到Linux上的坑
linux·运维·服务器
shizhan_cloud13 小时前
自动化部署Kubernetes集群
运维·kubernetes
瑞瑞小同学13 小时前
git 常用相关操作
git
mounter62513 小时前
【内核前沿】Linux IPC 迎来大变局?POSIX 消息队列增强、io_uring IPC 与 Bus1 十年回归
linux·运维·服务器·kernel·ipc·io_uring
金銀銅鐵14 小时前
[git] 如何合并若干个 commit?(上)
git