我已经用Gitolite安装了Gitlab,整个网站工作正常,它创建了回购就好......
但是,当我尝试从dev机器推送一些代码时,它会引发错误......
git init
git remote add origin ssh://git@gitbox.com:10000/test_of_mine.git
git add .
git commit -m "first commit"
git push origin master
输出:
fatal: '/test_of_mine.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
当我绕过gitolite时,添加一个带完整路径的遥控器,它会找到回购,但是有另一个错误,导致绕过
git remote add origin ssh://git@gitbox.com:10000/~git/repositories/test_of_mine.git
返回
Delta compression using up to 4 threads.
Compressing objects: 100% (329/329), done.
Writing objects: 100% (667/667), 785.81 KiB, done.
Total 667 (delta 327), reused 639 (delta 311)
remote: Empty compile time value given to use lib at hooks/update line 6
remote: Use of uninitialized value in require at hooks/update line 7.
remote: Can't locate Gitolite/Hooks/Update.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at hooks/update line 7.
remote: BEGIN failed--compilation aborted at hooks/update line 7.
remote: error: hook declined to update refs/heads/master
To ssh://git@gitbox.com:10000/~git/repositories/test_of_mine.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://git@gitbox.com:10000/~git/repositories/test_of_mine.git'
为什么我收到此错误?我错过了任何路径配置吗?
如何配置gitolite repo路径,我不需要绕过gitolite?
为什么gitlab应用程序运行正常,在正确的路径上创建存储库,而不会引起任何错误?
答案 0 :(得分:1)
对于GitLab4.2,Issue 2950提到了同样的错误(注意GitLab 5.0不再使用gitolite)。
尝试升级到最新的GitLab(使用gitlab-shell
代替gitolite)。
或至少仔细检查/home/git/repositories/
中是否存在。
您不应该尝试在当前设置中绕过gitolite,但第二条消息也会出现在Issue 1495中:
这是因为
$ENV{GL_LIBDIR}
未设置且~/.gitolite/hooks/common/update
需要{。}}。
gitolite的安装必须是不完整的。另外,请确保您的gitolite是V3.x,而不是V2。