错误提示如下:
git remote add origin git@github.com:yyyyjinying/my-test.git
git push -u origin master
$ git push -u origin master
The authenticity of host 'github.com (13.229.188.59)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,13.229.188.59' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法如下:
打开:Git Bash
第一步:查看ssy是否存在:$ ls -al ~/.ssh
第二步:如果没有生成新的ssy
$ ssh-keygen -t rsa -b 4096 -c "1020066395@qq.com"
passphrase:输入你想要设置的密码
same passphrase again:重复确认密码
第三步:在github中配置你生成的ssy
$clip < ~/.ssh/id_rsa.pub //拷贝你的ssy秘钥到剪切板;
之后就是github的setting->ssy->新建->复制啦
第四步:成功!