【git】配置代理访问github

github经常Couldn't connect to server

cpp 复制代码
zhangbin@DESKTOP-1723CM1 MINGW64 /g/CDN/NET-EQ-DEV
$ git clone https://github.com/TaoistKing/AudioPlc.git
Cloning into 'AudioPlc'...
fatal: unable to access 'https://github.com/TaoistKing/AudioPlc.git/': Failed to connect to github.com port 443 after 21266 ms: Couldn't connect to server

本人路径

  • C:\Users\zhangbin.ssh

在个人目录下的.ssh/config 增加这个不管用

bash 复制代码
Host github.com *.github.com # 指定代理规则作用域
  User git
  Port 22 # 端口号
  # 自己的私钥所在路径
  IdentityFile "~/.ssh/id_rsa"
  # SOCKS代理设置方法
  ProxyCommand connect -S 127.0.0.0:7891 %h %p
  # HTTPS代理设置方法
  ProxyCommand connect -H 127.0.0.0:7890 %h %p

报错

cpp 复制代码
zhangbin@DESKTOP-1723CM1 MINGW64 /g/CDN/NET-EQ-DEV
$ git clone git@github.com:TaoistKing/AudioPlc.git
Cloning into 'AudioPlc'...
FATAL: Unable to connect to relay host, errno=10060
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

单独给github设置代理

通过clash

  • 一定要allow lan
  • 一定有system proxy

zhangbin@DESKTOP-1723CM1 MINGW64 /g/CDN/NET-EQ-DEV

bash 复制代码
$ git config --global http.https://github.com.proxy socks5://127.0.0.1:7890
bash 复制代码
git config --global https.https://github.com.proxy socks5://127.0.0.1:7890

zhangbin@DESKTOP-1723CM1 MINGW64 /g/CDN/NET-EQ-DEV

$ git clone https://github.com/TaoistKing/AudioPlc.git

Cloning into 'AudioPlc'...

remote: Enumerating objects: 172, done.

remote: Counting objects: 100% (172/172), done.

remote: Compressing objects: 100% (150/150), done.

remote: Total 172 (delta 21), reused 166 (delta 19), pack-reused 0

Receiving objects: 100% (172/172), 392.65 KiB | 561.00 KiB/s, done.

Resolving deltas: 100% (21/21), done.

zhangbin@DESKTOP-1723CM1 MINGW64 /g/CDN/NET-EQ-DEV

$

相关推荐
vvw&3 小时前
如何在 Ubuntu 22.04 上安装 Graylog 开源日志管理平台
linux·运维·服务器·ubuntu·开源·github·graylog
HelloGitHub5 小时前
跟着 8.6k Star 的开源数据库,搞 RAG!
开源·github
大猫和小黄5 小时前
Windows、CentOS环境下搭建自己的版本管理资料库:GitBlit
linux·服务器·windows·git
孤水寒月5 小时前
Git忽略文件.gitignore
git·elasticsearch
DN金猿14 小时前
git命令恢复/还原某个文件、删除远程仓库中的文件
git
DWei_GaGa17 小时前
Git:查看分支、创建分支、合并分支
git
sdaxue.com17 小时前
帝国CMS:如何去掉帝国CMS登录界面的认证码登录
数据库·github·网站·帝国cms·认证码
m0_7482475517 小时前
github webhooks 实现网站自动更新
github
涵信19 小时前
Windows11 安装 Ubuntu-20.04,同时安装配置 zsh shell,配置 git 别名(alias),大大提高开发效率
linux·git·ubuntu·bash
张国荣家的弟弟19 小时前
【Yonghong 企业日常问题04】永洪BI可视化工具Linux部署全攻略(部署详解版)
linux·运维·github