git遇到的问题之“Please make sure you have the correct access rights and the repository

363 阅读1分钟

`

git 提交报错
On branch master nothing to commit (working directory clean)

然后git push origin master一下,
Please make sure you have the correct access rights and the repository exists.

ssh key有问题,连接不上服务器


1. 重新设置名字和有邮箱
git config --global user.name "yourname"
git config --global user.email“your@email.com"

2.删除C:\Users\MyPC\.ssh 下的known_hosts

3.git设置秘钥
 ssh-keygen -t rsa -C "your@email.com"(请填你设置的邮箱地址)
 接着按回车
 然后系统会自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,用记事本打开id_rsa.pub复制

4.登录github或者私服git仓库
  个人信息>SSH Key 添加新的秘钥

5.在git中输入 ssh -T git@github.com
  输入 yes  回车成功
 

`