why my git can't push to my server by gitolite use git-daemon

。_饼干妹妹 提交于 2019-12-10 18:46:11

问题


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)

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?


回答1:


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.

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

Any repo readable by the special user daemon is deemed to be readable by git-daemon.
For each of these repos, an empty file called git-daemon-export-ok is created in the repository (i.e., the repo.git directory inside $HOME/repositories).

So check if your gitolite.conf file does mention the user daemon, and if the file $HOME/repositories/git-daemon-export-ok is there.



来源:https://stackoverflow.com/questions/12494607/why-my-git-cant-push-to-my-server-by-gitolite-use-git-daemon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!