记录一个使用git过程中的小错误,谨供遇到类似错误的小伙伴参考。
问题:
今天push代码,莫名报错:
1 RSA host key for git.timacloud.cn has changed and you have requested strict checking. Host key verification failed. Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
fatal: Could not read from remote repository.
分析:
很明显的ssh keys**问题,机**验证失败。无法从远程存储库读取。也可能是权限问题,但是有代码权限的,所以尝试重置ssh keys。
解决:
1.删除本地**配置
文件位于:C:\Users\你的用户\.ssh
2.生成ssh keys
命令
ssh-****** -t rsa -C "[email protected]" (你的git账号)
一路回车,如下所示
3.git设置添加**(博主为gitlab,其他大同小异)
copy
copy刚刚生成的**,位于:C:\Users\你的用户\.ssh\id_rsa.pub文件
如上,粘贴进去,addkey。
4.再次push
提示:
The authenticity of host 'xxx' can't be established.
RSA key fingerprint is SHA256:F8M4R/YD9Gs8LdwoOyXqhdYorpPItIUQiWQrRqKDGFM.
Are you sure you want to continue connecting (yes/no)? yes
验证kes真实性。点击yes即可。并且会在keys**文件路径生成一个known_hosts文件。
正常情况,push顺利完成。
解决此问题。