克隆时git连接超时

问题描述 投票:0回答:2
Installing https://raw.githubusercontent.com/torch/rocks/master/cwrap-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/cwrap-scm-1.rockspec...
switching to 'build' mode
Cloning into 'cwrap'...
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Connection timed out

我正在尝试使用 git 安装软件包,但它不断出现错误。 我找不到其他人有这个问题,所以我想我会问

我正在运行一个 .sh 文件,该文件安装了某些代码所需的所有依赖项

https://github.com/kuz/DeepMind-Atari-Deep-Q-Learner/blob/master/install_dependency.sh

如有任何帮助,我们将不胜感激

github connection
2个回答
3
投票

您正在尝试通过未经身份验证的

git://
协议访问有问题的存储库,您可以在rockspec文件`中看到该协议。 GitHub 放弃了对该协议的支持,因为它未加密且不安全,并且容易遭到任意篡改。

您需要使用不同的协议。最简单的方法是更新该 URL,使其使用 HTTPS URL,该 URL 可以匿名使用,但很安全(GitHub 支持)。如果您做不到这一点,您可以运行

git config url.https://github.com/.insteadOf git://github.com/
,它会自动将 GitHub 上使用未经身份验证的 Git 协议的任何 URL 重写为其 HTTPS 版本。


0
投票

我发现运行命令 git config url.https://github.com/.而不是git://github.com/ 没用 通过将“clone https://github.com/...”部分中的“git”替换为“https”,命令按预期运行并将文件克隆到所需目录中

© www.soinside.com 2019 - 2024. All rights reserved.