git - 无法解析主机名

我在使用 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/

相关文章:

entity-framework - 如何更改 EntityFrameworkCore 迁移的存储位

c# - 计算两个日期之间的天数并将其显示在标签中

regex - 向量化模式匹配返回 R 中的模式

scala - 如何使用 Avro 序列化 Scala 案例类?

javascript - 一个语句中的多个问号 "?"和冒号 ":"如何在 javascript 中

sql - IPython SQL Magic - 以编程方式生成查询字符串

types - 结构的透析器错误

python - 删除元组列表中的括号

xamarin.forms - 从 Xamarin 的 Picker 中获取选定的值

erlang - 了解透析器结果