有谁见过这个错误,知道该怎么做吗?
我在使用终端,我在根目录下,GitHub仓库存在,我不知道现在该怎么做。
> git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
GitHub无法对你进行认证。 因此,要么你没有设置SSH密钥,因为你没有在你的机器上设置一个,要么你的密钥没有与你的GitHub账户关联。
你也可以用HTTPS URL来代替SSH/git URL,以避免处理SSH密钥的问题。 这是【GitHub推荐的方法】2。
此外,GitHub有一个专门针对该错误信息的帮助页面,并更详细地解释了你可以检查的一切。
这事发生在我身上。由于某些原因,我的起源在我没有意识到的情况下被弄乱了。
检查你的设置是否仍然正确
git remote -v
网址需要是类似于ssh://[email protected]/YourDirectory/YourProject.git。 如果你没有看到[email protected],请使用
git remote set-url origin git://github.com/YourDirectory/YourProject.git
来正确设置它。或者你可以使用github应用程序来检查,并在特定版本库的设置面板中设置主要远程版本库的网址。