我在使用 VPN 和使用 Windows 平台的专用网络中。我正在尝试使用
克隆一个 git 项目git clone ssh://git@domain-name:somestring/str-somestring.git
But I getting ssh: Could not resolve hostname domain-name: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我在我的本地生成了 ssh
,我也将其添加到我的本地存储库中。有人可以帮我吗?
我确信我拥有该项目的所有访问权限。
更新
ping google.com
在 VPN 外工作,同样在 VPN 内不工作
最佳答案
错误信息很清楚。 git
无法解析 domain-name
。
试试,在同一个 shell 中输入 git
命令:
ping domain-name
nslookup domain-name
它们也不会起作用,保证 99%。
如果是这样,最简单的解决方法是将该名称及其 IP 地址添加到 /etc/hosts
(像往常一样,与 git
无关)。当 ping
/nslookup
工作时,git
也会工作。
https://stackoverflow.com/questions/38740275/