当前位置:   article > 正文

Linux上git clone失败报错:fatal: unable to access..failed: The TLS connection was non-properly terminated.

Linux上git clone失败报错:fatal: unable to access..failed: The TLS connection was non-properly terminated.

我们在使用git clone项目时候经常会 clone失败

  1. fatal: unable to access 'https://github.com/xxxx/xxxx.git': Failed to connect to 127.0.0.1 port 8087: Connection refused
  2. 或是 fatal: unable to access 'https://github.com/zhayujie/chatgpt-on-wechat.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

解决办法:

通过ssh连接GitHub

1. 安装ssh
sudo apt-get install ssh


ssh-keygen 会确认密钥的存储位置和文件名(默认是 .ssh/id_rsa),然后全部回车即可。

2. 创建秘钥文件

ssh-keygen -t rsa -C "你的github账号邮箱"

再点击三次回车键

3.将公钥添加到GitHub账户

(1)将id_rsa.pub文件内容全部复制;

(2)登陆到GitHub上,右上角小头像->Setting->SSH and GPG keys中,点击new SSH key。

4. ssh测试

ssh -T git@github.com
结果为

表示配置成功。

5.重新git clone

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/560641
推荐阅读
相关标签
  

闽ICP备14008679号