Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
774 views
in Technique[技术] by (71.8m points)

git - ssh clone not working with github

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 [email protected]: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 [email protected], 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...