为什么我的git无法通过gitolite推送到我的服务器,所以使用git-daemon [英] why my git can't push to my server by gitolite use git-daemon
问题描述
当我使用gitolite时,忽略git-daemon
,我可以像git clone git://xxx/xxx
一样做,但是当我推送项目时,它向我显示了错误:
when I use gitolite, ignoring git-daemon
, I can do like git clone git://xxx/xxx
,but when I push the project, it shows me the error:
Total 2 (delta 0), reused 0 (delta 0)
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: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 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 git://www.54cxy.com/qianfuzi
! [remote rejected] master -> master (hook declined)
但是,当我像git@xxx:xxx.git
一样使用ssh
时,它不仅可以克隆而且可以推入,但是我想使用git://
进行克隆和推入,那么我能做什么使其起作用?
However, when I use ssh
like git@xxx:xxx.git
it worked not only can clone, but also can push, but I want to use git://
to clone and push, so what I can do for it to work?
推荐答案
诀窍是,如果要克隆由gitolite管理的git repo,则该远程repo将包含一个post-update
钩子(
The trick is, if you are cloning a git repo managed by gitolite, that remote repo will contain a post-update
hook (reserved by Gitolite), which is supposed to be called by gitolite.
通常,您可以使用本机git协议进行推送,前提是该存储库被用户守护程序"声明为可读(与git-daemon
"(对于GitoliteV3)
Normally, you should be able to push with the native git protocol, provided the repo is declared as readable by the user 'daemon' (see syntax, and see "Interfacing with git-daemon
" for GitoliteV3)
repo @all
R = gitweb daemon
特殊用户
daemon
可读的任何存储库都被git-daemon
视为可读.
对于每个这些存储库,都会在存储库中创建一个名为git-daemon-export-ok
的空文件(即$HOME/repositories
内的repo.git
目录).
Any repo readable by the special user
daemon
is deemed to be readable bygit-daemon
.
For each of these repos, an empty file calledgit-daemon-export-ok
is created in the repository (i.e., therepo.git
directory inside$HOME/repositories
).
因此,请检查您的gitolite.conf文件是否确实提到了用户daemon
,以及文件$HOME/repositories/git-daemon-export-ok
是否在那里.
So check if your gitolite.conf file does mention the user daemon
, and if the file $HOME/repositories/git-daemon-export-ok
is there.
这篇关于为什么我的git无法通过gitolite推送到我的服务器,所以使用git-daemon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!