【发布时间】:2016-08-27 05:51:37
【问题描述】:
我目前在 CentOS 6.5 上运行 GitLab Omnibus v7.1.0(称为 gitlab-a)。我使用 CentOS 6.8 (gitlab-b,这最终将升级到最新的 GitLab 8 版本) 构建了一个新的 GitLab 服务器,通过 RPM 包安装了 GitLab Omnibus v7.1.0 (gitlab-7.1.0_omnibus-1.el6.x86_64.rpm ),使用以下命令在原始服务器 (gitlab-a) 上运行备份:
sudo gitlab-rake gitlab:backup:create
我将生成的备份 tar 文件安全地复制到“新”服务器(在本例中为 gitlab-b)并恢复它:
bundle exec rake gitlab:backup:restore RAILS_ENV=production
我跑了:
sudo gitlab-rake gitlab:check SANITIZE=true
它抱怨权限和缺少卫星。我按照给定的方向:
chmod -R ug+rwX,o-rwx /var/opt/gitlab/git-data/repositories
chmod -R ug-s /var/opt/gitlab/git-data/repositories
find /var/opt/gitlab/git-data/repositories -type d -print0 | sudo xargs -0 chmod g+s
sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production
我测试了这个新安装(gitlab-b)并且能够git clone 和git pull 没有任何问题。但是,当我创建一个分支(称为 test-123),在 test-123 分支中进行更改,然后尝试 git push test-123 分支(git push origin test-123)时,我收到以下错误:
Counting objects: 5, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 331 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: GitLab: You are not allowed to access test-123!
remote: error: hook declined to update refs/heads/test-123
To git@gitlab.gitlab-b.com:project/repo.git
! [remote rejected] test-123 -> test-123 (hook declined)
error: failed to push some refs to 'git@gitlab.gitlab-b.com:project/repo.git'
我还注意到在新的 gitlab-b 服务器上,/var/opt/gitlab/git-data/repositories/project/repo.git/refs/heads 目录是空的。我认为这是问题的部分原因。我不确定如何解决。
这两天我搜索了大部分时间,发现了许多相关的问题和解决方案;不幸的是,我无法找到解决此问题的解决方案。任何让我朝着正确方向前进的想法或任何事情都将不胜感激!提前感谢您的宝贵时间。如果需要任何其他信息,请告诉我。
【问题讨论】:
-
您是否检查了 repo 的安全设置?是否配置了受保护的分支?并且:您可以尝试在服务器上的 repo.git 中手动创建您的分支(通过
git branch)吗? -
你好安德烈亚斯!对不起,我的回复延迟了。我们确实使用安全和受保护的分支。这些设置与 gitlab-a 存储库相匹配。我将此项目设置为内部和公共,但仍然无法推动。返回相同的错误。我是项目的所有者。我还在服务器上手动创建了 repo.git 并尝试推送 - 同样的错误。感谢您的时间和帮助。我真诚地感谢它。
标签: gitlab