fatal: Could not read from remote repository.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

今天连远程数据库,push项目的时候,报错了。

然后记录一下,解决思路:

1、确认git项目路径。 git  remote -v  查看远程项目路径

2、确认公钥    

3、确认权限(这个我还没遇到过)

接下来说解决方案:

1、解决方案:

  git  remote -v   看远程项目路径是否一致。

例如github项目:git@github.com是github的SSH连接地址 | https://github.com是github的http连接地址     

和你本地连接的仔细比对一下。

2、解决方案:

如果远程项目git地址正确,则考虑SSH公钥的问题,

看一下本地是否有这两个文件id_dsa / id_dsa.pub

或者在windows系统查看:C:UsersAdministrator.ssh

若没有,则生成并设置SSH公钥,步骤如下:

1、本地生成公钥

git命令:$  ssh-keygen

然后三个回车,就生成了。  

2、设置github公钥。

复制id_dsa.pub内容,

进入github开始设置,

进入新加SSH页面,复制进去,确认添加即可。(会提示需要输入github密码确认)

原文地址:https://www.cnblogs.com/hero123/p/9105822.html