fatal: unable to access ‘https://github.com/xxxx/’: Failed to connect to x.x.x.x port xxxxx: Connection refused|git clone问题(完美解决)

问题描述
执行以下命令克隆目标源码到本地时,会出现错误。

git clone https://github.com/RoboCup-SSL/technical-challenge-rules.git

错误:Cloning into 'technical-challenge-rules'... fatal: unable to access 'https://github.com/RoboCup-SSL/technical-challenge-rules.git/': Failed to connect to x.x.x.x port xxxx: Connection refused

按照wpyily|CSDN的方法,把克隆地址头缀由https://改为git@,可以克隆成功。但是每次都要注意这点,非常麻烦。所以,找到问题的根本原因,并找到了解决方法。下节介绍解决的方法。

解决方法
首先感谢前人的经验(tsq292978891|CSDN,以及无极天宗|新浪博客)。

tsq292978891|CSDN在它的博客中指出了问题的根本原因:原因是x.x.x.x port xxxxx被当作代理占用了,需要重启!!!

1.首先输入命令查看代理设置情况
 env|grep -i proxy 
NO_PROXY=localhost,127.0.0.0/8,::1
http_proxy=http://127.0.0.1:46759/
https_proxy=http://127.0.0.1:46759/
HTTPS_PROXY=http://127.0.0.1:46759/
no_proxy=localhost,127.0.0.0/8,::1
HTTP_PROXY=http://127.0.0.1:46759/

这个结果因人而异,其中代理的端口号与错误中显示的IP地址以及端口号一样,则说明是被该代理占用,需要unset所有与错误中提示的端口号相关的代理。

2.按文中的情况应依次执行以下四条命令,取消占用的代理
unset http_proxy

unset  https_proxy

unset   HTTPS_PROXY

unset   HTTP_PROXY

3.然后就可以愉快的git clone https://啦

4.然后 然后…,我发现每次启动新的窗口,又git clone 不了,发现在新的端口下代理又出现了,并且占用了那个端口。我找不出代理是从哪里设置的,不敢瞎整。此处有一个次优的方案,就是把取消代理的的命令放入.bashrc文件中,这样每次开启新窗口,就会自动清除代理,不影响git clone,也不影响科学上网。

找开.bashrc文件

gedit ~/.bashrc

在未尾添加红框中的一行

核心: 例如把http://192.168.1.79:8000/。。。改为 $ git clone git@192.168.1.79:8000/。。。。

fatal: unable to access https:// Failed to connect to: Connection refused|git clone问题(完美解决)相关推荐

  1. git的clone命令出现fatal:unable to access ‘https://github.comXXXXXXX“:OpenSSL SSL_read:connection was errn

    git使用git clone命令时出现错误fatal:unable to access 'https://github.comXXXXXXX":OpenSSL SSL_read:connec ...

  2. git报错fatal: unable to access ‘https://github.com/‘: OpenSSL SSL_read: Connection was reset

    bug描述 fatal: unable to access 'https://github.com/-': OpenSSL SSL_read: Connection was reset, errno ...

  3. git报错fatal: unable to access ‘https://github.com/.......‘: OpenSSL SSL_read: Connection was reset, e

    fatal: unable to access 'https://github.com/-': OpenSSL SSL_read: Connection was reset, errno 10054 ...

  4. 已解决:fatal: unable to access ‘https://github.com/.......‘: OpenSSL SSL_read: Connection was reset,

    昨天还可以git push代码到远程仓库,今天使用hexo d上传git仓库是时报了这个错:fatal: unable to access 'https://github.com/-': OpenSS ...

  5. 三种方法解决git拒绝连接问题fatal: unable to access xxxx: Failed to connect to xxxx : Connection refused

    git clone 拒绝连接,Connection refused 解决方法 一.使用env指令查询系统代理并取消对应http代理 二.使用git config指令查询代理并取消代理 三.直接修改.g ...

  6. 三种方法解决git拒绝连接问题fatal: unable to access xxxx: Failed to connect to xxxx : Connection refused

    git clone 拒绝连接,Connection refused 解决方法 一.使用env指令查询系统代理并取消对应http代理 二.使用git config指令查询代理并取消代理 三.直接修改.g ...

  7. Git报错解决:fatal: unable to access ‘https://github.com/...‘: OpenSSL SSL_read:..., errno 10054

    Git报错解决:fatal: unable to access 'https://github.com/-': OpenSSL SSL_read: Connection was reset, errn ...

  8. git push 报错:fatal: unable to access ‘https://github.com/...‘......

    问题: 在用git push 提交代码到 github 的时候,遇到了如下报错: fatal: unable to access 'https://github.com/-/': OpenSSL SS ...

  9. fatal: unable to access ‘https://github.comxxxxxxxxxxx‘: Failed to connect to xxxxxxxxxxxxx

    git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...

最新文章

  1. matlab能输入铁心参数,基于MATLAB的电力机车110伏直流稳压电源仿真研究
  2. CSS之Flexbox制作CSS布局易如反掌
  3. nanshan 钥匙在您那儿的
  4. 长沙学院计算机系课程表,长沙交通学院研究生200—200学年度第学期课程表.doc...
  5. 数据结构C语言实现系列——线性表(线性表链接存储(单链表))
  6. ubuntu16.04中 启动 Error starting userland proxy: listen tcp 0.0.0.0:5900: bind: address already in use
  7. Android自定义控件(四)——让每一个Activity UI都具有弹性
  8. 什么技术才值得你长期投入? | 凌云时刻
  9. 178.16. cvs release
  10. pdf reference官方指南之-文本和字体
  11. 创维智能网络机顶盒e950_拆创维E950机顶盒
  12. 基于单片机的人体健康检测系统
  13. p5.js之Q版人物绘制
  14. MT【352】极值点偏移
  15. 怎么调用计算机cad,CAD电脑版怎么使用教程
  16. 优质短视频内容有哪些特质?不要迷信爆款,通俗易懂很重要
  17. K210使用MaixPy IDE长时间显示连接中的解决方案
  18. proto plugin
  19. 删除文件后,磁盘可用空间并没有释放怎么办?
  20. ADFS 概念与基本开发介绍 (1)

热门文章

  1. mysql4.1.2缓冲区溢出漏洞_缓冲区溢出漏洞
  2. 大数据004——Hadoop
  3. 若依+websocket+springboot+elementui 实现消息推送
  4. 2021-08-11 WPF控件专题 ListView控件详解
  5. 2021-8-9 白化 蓝牙 blewhiten
  6. 作为过来人给Python编程入门者的三点忠告
  7. vscode调试代码方法
  8. 机器学习 | 混淆矩阵和两类错误的关系
  9. ES集群中出现UNASSIGNED分片时的解决思路
  10. 学习资料免费下载地址