最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

通过ssh连接GitHub 解决git clone失败 unable to access ‘https:github.com‘

运维笔记admin2浏览0评论

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

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

解决办法:

通过ssh连接GitHub

1. Linux安装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
结果为:,表示配置成功。

5.重新git clone

发布评论

评论列表(0)

  1. 暂无评论