// This works
git clone https://github.com/foreverjs/forever.git
// This one also works
git clone git@github.com:foreverjs/forever.git
// This one didn't work
git clone git://github.com/foreverjs/forever.git
第三个的错误信息是:
Cloning into 'forever'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
据我所知,通过 SSH 或 HTTPS 的 git clone 比 git://
协议(protocol)更受限制。我真的很困惑为什么我会收到此错误消息,因为 git://
协议(protocol)甚至不需要身份验证。
github 现在只允许通过 SSH 或 HTTPS 进行 git clone 还是我在这里遗漏了什么?
最佳答案
我本地电脑的gitconfig文件导致了这个问题,我在~/.gitconfig文件中找到了如下两行:
[url "ssh://"]
insteadOf = git://
如果我删除这两行,git://协议(protocol)将不会在 SSH 上运行,因此不会再有权限问题
关于git - 为什么git clone git ://is not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42220106/