git 致命:远端意外挂断

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14967621/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:11:59  来源:igfitidea点击:

Fatal: The remote end hung up unexpectedly

gitgithub

提问by szatan

I am working through the "Try Git"tutorial.

我正在学习“尝试 Git”教程。

When I get to the chapter "1.11 Pushing Remotely", and try to run:

当我到达“1.11 远程推送”一章时,并尝试运行:

$ git push -u orgin master

I get this error:

我收到此错误:

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Any ideas?

有任何想法吗?

采纳答案by David Cain

You've probably not added a public key to your SSH keys. Do that:

您可能没有在 SSH 密钥中添加公钥。去做:

$ ssh-keygen -t rsa

Copy the created public key (id_rsa.pub) to your account's list of SSH keys, then try pushing again.

将创建的公钥 ( id_rsa.pub)复制到您帐户的SSH 密钥列表,然后再次尝试推送。



See the relevant help page: Generating SSH Keysfor a more in-depth response.

请参阅相关帮助页面:生成 SSH 密钥以获得更深入的响应。

回答by yeafee

You can use the below command to get keys for the default account.

您可以使用以下命令获取默认帐户的密钥。

$ ssh-keygen -t rsa

More info: Multiple SSH Keys settings for different github account

更多信息:不同 github 帐户的多个 SSH 密钥设置