在git clone项目时出现过两次这个问题,第一次是在自己电脑上把本地项目推送到远程后加了ssh,然后在公司电脑去git clone时出现了这个问题,第二次是自己电脑重装系统后,再去git clone时出现了这个问题。究其原因,都是因为本地仓库和远程的ssh不匹配

解决办法:

1、当出现Are you sure you want to continue connecting (yes/no)?时,选择yes

The authenticity of host 'github.com (0.0.0.0)(里面是你的ip地址)' can't be established.

2、ls -al ~/.ssh

The authenticity of host 'github.com (0.0.0.0)(里面是你的ip地址)' can't be established.

3、ssh-****** -t rsa -C "你的github用户名",然后按三次回车

The authenticity of host 'github.com (0.0.0.0)(里面是你的ip地址)' can't be established.

4、cat ~/.ssh/id_rsa.pub生成新的SSH

The authenticity of host 'github.com (0.0.0.0)(里面是你的ip地址)' can't be established.

5、登陆github,点击头像-settings-new SSH,复制新生成的SSH

The authenticity of host 'github.com (0.0.0.0)(里面是你的ip地址)' can't be established.

The authenticity of host 'github.com (0.0.0.0)(里面是你的ip地址)' can't be established.

6、可以正常clone

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-10-19
相关资源
相似解决方案