gpt4 book ai didi

git - ssh 克隆不适用于 github

转载 作者:IT王子 更新时间:2023-10-29 01:28:47 27 4
gpt4 key购买 nike

我是 Git 和 GitHub 的新手。

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

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

  • git clone https://github.com/npsabari/testrepo.git
  • git 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

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

"Permission denied (publickey)."

而不是欢迎信息。

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

最佳答案

根据 GitHub help , error you're getting与错误的 SSH 配置有关。请按照 setting up SSH for GitHub 的说明进行操作并进行相应检查。

关于git - ssh 克隆不适用于 github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11585636/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com