git clone Timed out 解决
2024-08-24 23:02:58
因为不可抗拒的原因,在乌鲁木齐从 github 上面克隆项目时,会超时克隆不了。
使用 https 方式报错:
$ git clone https://github.com/xxx.git
Cloning into 'xxx'...
fatal: unable to access 'https://github.com/xxx.git/': Failed to connect to github.com port : Timed out
使用 ssh 方式报错:
$ git clone git@github.com:xxx.git
Cloning into 'xxx'...
ssh: connect to host github.com port : Connection timed out
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.
场景:使用 vpn
github 可以正常访问,git clone 运行超时
解决方法:
1. 配置 git 的代理
git config --global http.proxy "127.0.0.1:1080"
git config --global https.proxy "127.0.0.1:1080"
这里是关键:需要本地启动 vpn
2. 使用 https 方式 clone
$ git clone https://github.com/xxx.git
注意:这里必须使用 https 方式, ssh 方式即使配置了 git 的代理也不好使。。。
吐槽:
也不知道屏蔽个 github 干嘛,前阶段 csdn 也屏蔽了,不过还好最近放开了。
最新文章
- Smarty模版引擎的原理
- 实战MEF(5):导出元数据
- HTML5图形图像处理技术研究
- apache开启.htaccess及.htaccess的使用方法(转)
- Cocos2d-x 3.2 学习笔记(十三)CocoStudio UI编辑器 by 保卫萝卜
- Beta版本——第三次冲刺博客
- python idle 清屏问题的解决
- css 正方体
- java泛型的使用
- IPAddress
- php 解决乱码的通用方法
- geyear和getfullyear的区别
- java.lang.RuntimeException: java.sql.SQLException: Too many parameters: expected 0, was given 1 Quer
- java内部类demo
- .NET企业级应用WebService上传下载文件
- CarbonData-1:common
- github 遇到Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts问题解决
- HNUOJ 13341
- Jenkins配置基于角色的项目权限管理
- Unity 5 Game Optimization (Chris Dickinson 著)