有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,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.
当前回答
GitHub无法验证你的身份。所以,要么你没有安装SSH密钥,因为你还没有在你的机器上设置一个,要么你的密钥没有与你的GitHub帐户相关联。
您还可以使用HTTPS URL而不是SSH/git URL来避免必须处理SSH密钥。这是GitHub推荐的方法。
此外,GitHub有一个专门针对该错误消息的帮助页面,并更详细地解释了您可以检查的所有内容。
其他回答
我最近也遇到了同样的问题。如果您需要立即修复,这可能会有所帮助,但每次重新启动系统时都需要这样做
在终端执行:ssh-add ~/.ssh/id_rsa
输入系统密码就可以了。
我得到了这个错误。原来我刚刚将OSX升级到Sierra,我的旧密钥不再注册了。
一开始我以为是“升级到macOS Sierra会破坏你的SSH密钥并将你锁在自己的服务器之外”
但我避开了这个问题。结果我只需要重新注册我现有的密钥:
ssh-add - k
然后输入密码…完成了!
如果您将ssh访问更改为https访问远程存储库,问题就解决了:
git remote set-url origin https_link_to_repository
git push -u origin master
可能您的ssh-agent未启用 你可以试试
下载
http://git-scm.com/
安装它 使ssh-agent
C:\Program Files\Git\cmd
start-ssh-agent
使用Https是可以的,运行git config——global credential。帮助wincred创建一个Github凭据帮助存储您的凭据为您。如果这不起作用,那么您需要编辑.git目录中的配置文件,并将原始文件更新为https url。
查看github文档的链接。