Git问题(三)Warning: Permanently added the RSA host key for IP address

前言

本章主要衔接Git(二)有相关问题未解决

问题:当实行git clone 操作命令时报错
Warning: Permanently added the RSA host key for IP address

原因:由于未配置公钥

1.问题

Git问题(三)Warning: Permanently added the RSA host key for IP address_第1张图片

2.解决

1.打开git bash

2.输入cd C:

3.cat ~/.ssh/id_rsa.pub
Git问题(三)Warning: Permanently added the RSA host key for IP address_第2张图片

  • 正常显示应该会出现一大段字符串:ssh-rsa… 即公钥

  • 但是如果提示如上图所示的话则说明没有公钥,此时你应当自己创建一个公钥,输入

      ssh-keygen
    

然后一直回车就行,最后会生成如下图所示图:
Git问题(三)Warning: Permanently added the RSA host key for IP address_第3张图片

4.此时说明公钥已生成,重复步骤3,下面这一大段就是publickey,右键copy复制。

Git问题(三)Warning: Permanently added the RSA host key for IP address_第4张图片
5.打开浏览器登录你的github,点击右上角头像–>settings–>(personal settings中的)SSH and GPG keys–>new SSH key–>title自己取名,key中粘贴publickey–>Add SSH key–>成功!(步骤如下图所列)
Git问题(三)Warning: Permanently added the RSA host key for IP address_第5张图片
Git问题(三)Warning: Permanently added the RSA host key for IP address_第6张图片
Git问题(三)Warning: Permanently added the RSA host key for IP address_第7张图片
添加成功
Git问题(三)Warning: Permanently added the RSA host key for IP address_第8张图片

6.再次连接即可

你可能感兴趣的:(Git)