git - 更改 GitLab SSH 主机

标签 git ssh gitlab hostname

我不久前使用 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 says localhost. 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 the 127.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/

相关文章:

带有 DiffMerge 设置的 git 来模仿带有 diffmerge 的 Mercurials 设置

javascript - 无法修改和测试 fork 的 GitHub 库 - npm 错误!找不到版本

mysql - 在 ssh 命令中设置 autocommit=0

docker - 运行 Gitlab Docker

docker - 在端口 80 上运行 Gitlab Docker 容器 ERR_CONNECTION_REFUSED

nginx - 如何增加 gitlab CE lfs 文件大小限制以避免出现 500 服务器错误?

Git:远程拒绝,无法将对象迁移到永久存储

Git:如何将相同的修改应用到另一个分支?

python - 进程的输出显示在多个控制台中

MySql Workbench 无法打开 SSH 隧道