git 克隆:没有与名称关联的地址

git clone : no address associated with name

我知道有很多关于此的问题,但我发现它们对我的情况不起作用
因为我不太了解 git 我在从 openshift 服务器克隆 repo 时遇到了问题。 我的存储库有 ssh URL (形式为 ssh://some_text@my_site_url/~/git/my_app.git/ ),但是当我尝试使用

克隆 repo 时
git clone ssh://somt_text@my_site_url/~/git/my_app.git/

我收到这条错误消息

Cloning into 'my_app'...

ssh: Could not resolve hostname my_site_url: no address associated with name
fatal: Could not read from remote repository.

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

我在我大学的代理服务器后面使用 git,所以我使用

设置了 git 代理
git config --global http.proxy httpProxy:port
git config --global https.proxy httpProxy:port

如果我遗漏了任何步骤或做错了什么,请提出建议。

注意:我正在使用 OpenShift 托管我的项目,并尝试在我的本地计算机上使用 ssh 访问它。

我觉得如果你用ssh就够了

绝对路径: git 克隆用户@example.com:/home/my_user/git/my_app.git

相对路径: git 克隆用户@example.com:git/my_app.git

你没有漏掉任何一步,但你似乎是using git behind a proxy

只需正确配置您的代理,甚至在此之前,请确保您的代理为您提供使用 ssh 的权限(如果没有,您必须选择其他选项才能使用 https url无论如何).

您甚至可以尝试使用 github 代替默认的 OpenShift git 存储库( 正如您在评论中提到的 ),即将为您提供更多选择,当然还有更多解决方案,以防您再次 运行 遇到任何问题。

查看这些以获得更多帮助: