SSH克隆不与Github一起工作 [英] ssh clone not working with github

查看:163
本文介绍了SSH克隆不与Github一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Git和GitHub的新手。



我创建了一个新的存储库,并试图在本地机器上克隆。 $ b

它适用于https和git-readonly网址。也就是说,以下工作正常:


  • git clone https://github.com/npsabari/testrepo。 git

  • git clone git://github.com/npsabari/testrepo.git



但是当我尝试 git clone git@github.com:npsabari / testrepo.git ,它没有工作。它给出了以下错误消息:

 克隆到'testRepo'... 
Permission denied(publickey)。
致命:远程终端意外挂起

然后我试着 ssh git@github.com ,但我得到了错误:

 Permission denied(publickey )。 

而不是欢迎信息。



我应该怎么做才能解决这个问题?什么是错误的原因?

解决方案

根据GitHub >帮助,那么错误与错误的SSH相关组态。请遵循为GitHub设置SSH 的指示,并相应地进行检查。


I am new to Git and GitHub.

I created a new repository and tried to clone on my local machine.

It worked for https and git-readonly URLs. That is, the following worked fine:

  • git clone https://github.com/npsabari/testrepo.git
  • git clone git://github.com/npsabari/testrepo.git

But when I tried git clone git@github.com:npsabari/testrepo.git, it didn't work. It gave the following error message:

Cloning into 'testRepo'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

And then I tried ssh git@github.com, but I got the error:

"Permission denied (publickey)."

instead of the welcome message.

What should I do to fix this? What is the reason for the error?

解决方案

As per GitHub help, the error you're getting is related to wrong SSH configuration. Please follow indications for setting up SSH for GitHub and check accordingly.

这篇关于SSH克隆不与Github一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆