GitLab没有与Gitolite交互

时间:2012-11-02 06:32:29

标签: git debian gitolite gitlab

我安装并配置了GitLab。我将我的公钥添加到我的帐户,然后添加了一个项目。不幸的是,该项目似乎不存在于Gitolite中,我的密钥似乎也没有添加(不是.gitolite / keydir或.ssh / authorized_keys)

GitLab没有抱怨,项目创建得很好。权限是正确的,根据gitlab:app:status,但它表示项目缺少post_receive文件..这不足为奇,因为/ home / git / repositories中没有项目

gitlab@server:~$ bundle exec rake gitlab:app:status RAILS_ENV=production
Starting diagnostics
config/database.yml............exists
config/gitlab.yml............exists
/home/git/repositories/............exists
/home/git/repositories/ is writable?............YES
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Can clone gitolite-admin?............YES
UMASK for .gitolite.rc is 0007? ............YES
/home/git/.gitolite/hooks/common/post-receive exists? ............YES
Validating projects repositories:
Herp.....post-receive file missing
rake aborted!
unexpected return

Tasks: TOP => gitlab:app:status
(See full trace by running task with --trace)

编辑:gitolite-admin repo确实存在。我能够克隆gitolite-admin repo并写入该目录:

gitlab@server:~$ git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
Cloning into '/tmp/gitolite-admin'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
Receiving objects: 100% (6/6), 751 bytes, done.
remote: Total 6 (delta 0), reused 0 (delta 0)

gitlab@server:~$ mkdir /home/git/repositories/test
gitlab@server:~$ touch /home/git/repositories/test/asdf

我很茫然,因此GitLab无法使用。我该怎么办?我不确定在哪里开始寻找。

提前致谢。

1 个答案:

答案 0 :(得分:3)

对我而言,这个问题的根源是对gitolite-admin回购的承诺被拒绝了:

2012-11-05.18:54:07     gitlab  127.0.0.1       git-receive-pack 'gitolite-admin'
2012-11-05.18:54:07     gitlab  127.0.0.1       Die generated at line 251 in /home/git/bin/gl-compile-conf : <<newline>>                ***** ABORTING *****<<newline>>        git config core.sharedRepository not allowed<<newline>>check GL_GITCONFIG_KEYS in the rc file for how to allow it<<newline>> <<newline>>

当我检查/home/git/.gitolite.rc GL_GITCONFIG_KEYS是否$GL_GITCONFIG_KEYS = ".*"; 时,我发现该变量的值为空字符串。我不得不手动更改它:

$GIT_CONFIG_KEYS = '.*';

(我从issue 1769中指定的迁移sed行推断 - 我认为给定的sed行被破坏了)

对于gitolite v3,您可能需要设置此变量

sudo -u gitlab git config --global user.name Gitlab
sudo -u gitlab git config --global user.email gitlab@localhost

添加此变量可以解决我的问题。

编辑:japgolly建议的替代问题和解决方案是安装说明忘记了一步:

{{1}}

也导致gitolite-admin的提交失败(默默地)