Azure 上的 GitLab 无法解析主机

标签 git azure ssh gitlab azure-virtual-machine

我已经按照以下步骤在 Azure 上安装了 GitLab: http://docs.gitlab.com/ce/install/azure/index.html

现在,mygit.northeurope.cloudapp.azure.com 上运行着一个新的虚拟机,并开放了端口 22、80 和 443。我可以通过上面的链接登录我的 GitLab。

我在本地设置了以下内容:

git config --global user.name "Me My"
git config --global user.email "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f020a4102162f06410c0002" rel="noreferrer noopener nofollow">[email protected]</a>"

以及根据 https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ 的 ssh 内容

我已经在我的 GitLab 存储库中创建了一个项目(在一个组内),但是,无论我尝试通过 SSH 或 HTTP 克隆或推送现有代码,我都会收到以下错误消息:

ssh: Could not resolve hostname gitlab-ce.blablabla.cx.internal.cloudapp.net:MyGroup/MyProject.git: 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.

还有

fatal: unable to access 'http://gitlab-ce.blablabla.cx.internal.cloudapp.net:MyGroup/MyProject.git/': Could not resolve host: gitlab-ce.blablabla.cx.internal.cloudapp.net

我可能会错过什么?任何帮助将不胜感激!

最佳答案

What could I be missing? Any help would be appreciated!

在 Azure 中,Gitlab 是预配置的,因此 external_url 是一个示例,而不是现有地址,我们应该将其更改为您的域名。

我们在这里找到external_url:/etc/gitlab/gitlab.rb 将其从 http://gitlab-ce.hxakzvpf0otezeojz3wqhme5wg.cx.internal.cloudapp.net 更改为您的虚拟机域名(我们可以通过 Azure 门户找到它),如下所示:

enter image description here

然后运行 ​​sudo gitlab-ctl reconfigure 以使更改生效。

现在,我们可以刷新浏览器来获取新的http地址,如下所示:

enter image description here

然后我们就可以使用这个新地址来 pull 或克隆。

希望这有帮助。

关于Azure 上的 GitLab 无法解析主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47657705/

相关文章:

git - 错误 : RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

powershell - Windows 中的 Git Shell : patch's default character encoding is UCS-2 Little Endian - how to change this to ANSI or UTF-8 without BOM?

azure - 如何检查 powershell 脚本是否正在 Azure 中运行

Azure Webapp Keyvault 引用以及暂存槽的用户分配标识

git - docker 中的 ssh-add - 无法打开与您的身份验证代理的连接

go - 通过堡垒主机进行 SSH

git - 为什么 git gui 不尊重 git hook 添加的注释行?

通过 ssh 从远程存储库 :fatal: protocol error: bad line length character: fata 进行 git 克隆

azure - Azure Synapse Link 是在数据仓库中加载数据的好方法吗?

git - 无法对我拥有的 github 存储库进行身份验证