我创建了一个新的远程仓库,并试图使用git push -u origin master
命令后,我对我的本地文件推到新的存储库中的第一次add
它和commit
它。但是,它弹出了[email protected]: Permission denied (publickey). fatal: Could not read from remote repository.
。如何解决此致命错误?
我已经尝试过
使用Git时如何解决“权限被拒绝(公钥)”错误?似乎此链接中的问题是第一次使用git发生。我已经使用了git一段时间,是否仍然需要遵循此解决方案?谁能给我一个更具体的解决方案?
这是我得到的致命错误
C:\Users\ASUS\Desktop\React-Practice App\my-app>git status
On branch master
nothing to commit, working tree clean
C:\Users\ASUS\Desktop\React-Practice App\my-app>git push -u origin master
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
您正在通过SSH访问GitHub。首先生成一个SSH密钥对;然后将公钥添加到GitHub。
生成密钥对:
ssh-keygen -t rsa -b 4096 -C “[email protected]”
在https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent和https://help.github.com上查看更多信息/ zh-CN / articles /将新的ssh-key添加到您的github帐户
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句