我不久前使用 Omnibus 包安装了 GitLab。
当我使用 Gitlab Web UI 创建项目时,一切正常。
我想要更改的是项目页面顶部显示的 SSH 主机名。
例如,我的实际主机名是“git@xxxx:group/repo.git”,我希望它是“git@yyyy:group”/repo.git”。
我已经更改了 config/gitlab.yml
中的“主机”配置和 /etc/hostname
中的主机名,然后运行 gitlab-ctl reconfigure "
但 SSH 主机名仍然相同。
最佳答案
issue 1875详细说明更新主机名需要执行哪些操作:
(它是从最近的 issue 8396 引用的)
Open up
config/gitlab.yml
and there are a couple places where it sayslocalhost
. You can do a search to make sure you get them all.The first one is towards the top.
web:
host:
The second one is towards the bottom (this is the one that will impact the path)
git:
path:
Then restart gitlab
service gitlab stop; service gitlab start
Turned out that I needed to run
bundle exec rake gitlab:app:status RAILS_ENV=production
in the /home/gitlab/gitlab folder as user gitlab
AND
(I don't know if this was necessary) I changed the order of the127.0.0.1
line in/etc/hosts
from:
127.0.0.1 localhost gitlab gitlab.domain.com
TO
127.0.0.1 gitlab.domain.com gitlab localhost
关于git - 更改 GitLab SSH 主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27543432/