有人看到这个错误并知道该怎么做吗?
我正在使用终端,我在根,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访问更改为https访问远程存储库,问题就解决了:
git remote set-url origin https_link_to_repository
git push -u origin master
其他回答
GitHub无法验证你的身份。所以,要么你没有安装SSH密钥,因为你还没有在你的机器上设置一个,要么你的密钥没有与你的GitHub帐户相关联。
您还可以使用HTTPS URL而不是SSH/git URL来避免必须处理SSH密钥。这是GitHub推荐的方法。
此外,GitHub有一个专门针对该错误消息的帮助页面,并更详细地解释了您可以检查的所有内容。
这可能是由于您的SSH密钥/ GPG需要在您的组织github或gitbucket站点上更新。 遵循以下步骤来鞋底:
在cmd:键入>> $ ssh-keygen -t rsa -C "your_email@example.com"(结果创建id_rsa和id_rsa.pub) $ ssh-add ~/.ssh/id_rsa 猫~ / . ssh / id_rsa。Pub并复制密钥,然后到你的org bitbucket/ github站点,并将其粘贴到SSH密钥上
你可以试试这种方法……
选择其他链接
我也遇到了和蝙蝠侠类似的问题。但是,因为我是在/usr/local/src/projectname下运行的,所以不使用sudo是不行的。
只需添加-E标志来保护环境(您的~/。ssh /路径)。
$ sudo -E git克隆git@your_repo
来自man sudo:
- e, preserve-env 指示用户希望预先设置的安全策略 服务于它们现有的环境变量。安全 如果用户没有权限,策略可能会返回错误 保护环境。
允许对密钥(标识)进行写访问,然后单击“添加密钥”
如果在Windows上,请检查通过SSH使用Github中的更多详细信息。