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. Failed during: git fetch origin master:refs/remotes/origin/master --tags --force
导致原因:秘钥没有设置或设置不正确。
解决方案:重新设置密钥。
第一步:创建SSH Key:
运行cmd输入命令:ssh-keygen -t rsa -C "youremail@example.com",youremail@example.com是你的git邮箱地址。接着一路回车即可。打开cmd运行目录,我这里是C:\Users\Administrator,找到.ssh目录,进入目录,复制id_rsa.pub的内容。
第二步:登录github,点击右上角头像->点击Settings->点击SSH and GPG keys->点击 New SSH key,任意输入一个名称,粘贴第一步复制的id_rsa.pub内容并保存。