git提交报错:Please make sure you have the correct access rights and the repository exists.

报错截图:

解决方法:
1、C:Userscxy.sshknown_hosts 清空内容
2、执行E:softwareGitGitgit-bash.exe
3、执行: $ ssh-keygen -t rsa -C "username"
4、$ ssh -T git@code.bonc.com.cn
  输入git密码
5、登录code.bonc.com.cn,登录
——setting——SSH Keys——删除之前的ssh keys,然后新建ssh keys,将C:Userscxy.sshid_rsa.pub下的内容全选复制,粘贴到新建ssh keys框中,保存
6、在IDEA中再次点击commit and push,代码可正常commit and push

原文地址:https://www.cnblogs.com/ying1314/p/13049604.html