fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.

如果在git push时出现了上述情况,或者说Please make sure you have the correct access rights and the repository exists.那么可以尝试两种解决办法

添加ssh公钥,首先查看自己本地的ssh公钥(cat ~/.ssh/id_rsa.pub)将输出的内容复制粘贴到你的github账号的Settings–>SSH and GPG keys然后点击New SSH keys添加你的公钥,title随便起一个就行。

如果在github上已经存在你的本地公钥了,那么你可以先删除远程仓库,然后再利用ssh公钥添加:

  • git remote remove 你的github名
  • git remote add origin [email protected]:你的账户名/仓库名.git

然后git push origin master试试

你可能感兴趣的:(git,github,ssh,openssh)