Git 权限被拒绝(公钥)/致命:远程端意外挂起?

Git 权限被拒绝(公钥)/致命:远程端意外挂起?,git,github,ssh,Git,Github,Ssh,因此,我使用以下命令开始制作一个Jekyll站点 $ git clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com $ cd USERNAME.github.com $ git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git 在建立本地和github回购协议后,我尝试将更改发送到github $ git pu

因此,我使用以下命令开始制作一个Jekyll站点

$ git clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com
$ cd USERNAME.github.com
$ git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git
在建立本地和github回购协议后,我尝试将更改发送到github

$ git push origin master
要找到这个,

Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

我做错了什么?如何解决此错误?

权限被拒绝(公钥)表示服务器拒绝了您的连接。检查详细信息

问题在于您尚未使用Github初始化SSH密钥。这为我解决了问题:

cd ~/.ssh && ssh-keygen
cat id_rsa.pub 
并将密钥复制到Github网站的SSH设置中


然后就可以继续了。

您可以从Github帐户创建SSH。

如果要推送大文件,请尝试此操作,它会将推送容量更改为500 MB

$ git config http.postBuffer 524288000 
或者尝试此操作,将原点设置为master

$ git push origin master 

或者检查internet连接的代理设置。如果您正在使用某些代理,请将其更改为noproxy。git push将在noproxy模式下工作

仅供参考:如何使用Bitbucket