我是Git和GitHub的新手.
我创建了一个新的存储库,并尝试在我的本地计算机上克隆.
它适用于https和git-readonly URL.也就是说,以下工作正常:
git clone https://github.com/npsabari/testrepo.gitgit clone git://github.com/npsabari/testrepo.git但是当我尝试时git clone git@github.com:npsabari/testrepo.git,它没有用.它给出了以下错误消息:
Cloning into 'testRepo'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
然后我尝试了ssh git@github.com,但我得到了错误:
"Permission denied (publickey)."
Run Code Online (Sandbox Code Playgroud)
而不是欢迎消息.
我该怎么做才能解决这个问题?错误的原因是什么?