记录一个使用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-keygen -t rsa -C "xxx@xxx" (你的git账号)
一路回车,如下所示