有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,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存储库存在,我不知道现在该做什么。
> 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.
当前回答
如果您已经创建了SSH密钥,但仍然报错,这是因为您需要给用户读写要克隆到的文件夹的权限。sudo chmod 777 <your_folder_name_here>"。 当然,这是在生成SSH密钥之后,仍然会得到这个错误。希望这对未来的用户有所帮助。
Edit
如果你使用git bash,在Windows中使用admin来添加
其他回答
排除故障的步骤
这发生在SourceTree上 在我的例子中,我的公私钥对出了问题。所以我删除这对并生成一个新的来解决我的问题
在将GitHub添加为远程时,使用该页面的URL。 它不会引起任何这样的错误和推动代码
您可以使用Https url登录
我猜你是试图登录SSH url 当你说git push,如果它只要求密码,考虑你是通过ssh连接。最好使用HTTP url。
这招对我很管用:
1-删除所有起源
git remote rm origin
(参见https://www.kernel.org/pub/software/scm/git/docs/git-remote.html)
*remote: "管理你所跟踪的分支的存储库集合("remotes")。
*rm: "删除已命名的远程。所有远程跟踪分支和远程配置设置都被删除。”
2-检查所有已删除:
git remote -v
3-添加新的产地主
git remote add origin git@github.com:YOUR-GIT/YOUR-REPO.git
这就是所有的朋友们!
你需要生成一个SSH密钥(如果你没有的话),并将公钥与你的Github帐户相关联。参见Github自己的文档。