我正在浏览Github的分叉指南:https://guides.github.com/activities/forking/ 我正在尝试将存储库克隆到我的计算机上。但是,执行以下命令:

$ git clone https://github.com/./Spoon-Knife.git
Cloning into 'Spoon-Knife'...
fatal: protocol 'https' is not supported

也尝试了SSH:

$ git clone git@github.com:./Spoon-Knife.git
Cloning into 'Spoon-Knife'...
Warning: Permanently added the RSA host key for IP address '.' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我需要改变我的计算机上的一些配置设置,或者这是一个问题与GitHub?

编辑:我已经用“”替换了我的用户名和IP地址。


当前回答

使用http而不是https;它会给出警告信息并重定向到https,得到克隆没有任何问题。

$ git clone http://github.com/karthikeyana/currency-note-classifier-counter.git
Cloning into 'currency-note-classifier-counter'...
warning: redirecting to https://github.com/karthikeyana/currency-note-classifier-counter.git
remote: Enumerating objects: 533, done.
remote: Total 533 (delta 0), reused 0 (delta 0), pack-reused 533
Receiving objects: 100% (533/533), 608.96 KiB | 29.00 KiB/s, done.
Resolving deltas: 100% (295/295), done.

其他回答

使用http而不是https;它会给出警告信息并重定向到https,得到克隆没有任何问题。

$ git clone http://github.com/karthikeyana/currency-note-classifier-counter.git
Cloning into 'currency-note-classifier-counter'...
warning: redirecting to https://github.com/karthikeyana/currency-note-classifier-counter.git
remote: Enumerating objects: 533, done.
remote: Total 533 (delta 0), reused 0 (delta 0), pack-reused 533
Receiving objects: 100% (533/533), 608.96 KiB | 29.00 KiB/s, done.
Resolving deltas: 100% (295/295), done.

我得到了一个看起来非常类似的错误,因为我在URL周围放了单引号:

致命:不支持协议“https”

从URL中删除单引号可以解决这个问题。

在我全新的Ubuntu服务器上也有同样的问题,然后我意识到我的系统上没有安装网络工具。

首先运行sudo apt install net-tools 然后更新你的系统sudo apt update

现在尝试使用nginx打开80端口,可以使用sudo apt install nginx安装,并使用sudo ufw allow ' nginx HTTP'打开80端口。

同样的端口8080 https运行sudo ufw允许'Nginx https '

尝试重新启动您的系统,现在尝试克隆回购。

编辑:通过启动一个新的终端会话解决了这个特定的用户问题。

一个吗?之前协议(https)不支持。你想要的是:

克隆git@github.com: octcat /Spoon-Knife.git

或:

git 克隆 https://github.com/octocat/Spoon-Knife.git

当我试图聪明地从回购的URL中提取克隆URL时,我得到了这个错误。我做错了。我正在做:

git@https://github.company.com/Project/Core-iOS

我必须这样做:

git@github.company.com:Project/Core-iOS.git

我犯了3个错误:

不需要https:// 在。com之后我需要:而不是/ 最后我需要一个。git