git 上传项目失败

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秘钥出错,重新设置就行

获取秘钥方式:

第一、验证用户名和邮箱  git config --global --list

第二、ssh-keygen -t rsa -C "自己的邮箱地址" 生成秘钥

第三、去C:UsersAdministrator.ssh文件夹加  打开id_rsa.pub文件,把里面的内容复制

第三、去github网站添加秘钥

原文地址:https://www.cnblogs.com/zhaobao1830/p/12874928.html