我已经按照以下步骤在 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 门户找到它),如下所示:
然后运行 sudo gitlab-ctl reconfigure
以使更改生效。
现在,我们可以刷新浏览器来获取新的http地址,如下所示:
然后我们就可以使用这个新地址来 pull 或克隆。
希望这有帮助。
关于Azure 上的 GitLab 无法解析主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47657705/