Git Push错误预接收挂钩被拒绝 [英] Git push error pre-receive hook declined
问题描述
我已按照本教程1-6中的步骤在虚拟机上运行gitlabhq rails服务器
I have run gitlabhq rails server on virtual machine, following 1-6 steps from this tutorial https://github.com/gitlabhq/gitlab-recipes/blob/master/install/centos/README.md and starts rails server executing command sudo -u git -H bundle exec rails s -e production
. After that I created user, using admin tools and created new project under this user. Then I'm trying to push the existing project to this repo as always. But in the last step, git push origin master
fails with the error
[远程拒绝]主机->主机(预接收挂钩被拒绝)
[remote rejected] master -> master (pre-receive hook declined)
其他信息:
1)我尚未通过电子邮件激活链接激活用户(项目所有者),因为我尚未在服务器端配置邮递服务,并且在本手册中也没有找到有关操作方法的说明.
1) I haven't activated user (project owner) via email activation link, because I haven't configured post service on server-side and I didn't find instructions how to do that in this manual.
2)Gitlab服务器生成提示,提示如何将项目推送到仓库中,并且路径中没有repositories/
.我的意思是它会生成git@mygitlabhost:user/repo.git
而不是git@mygitlabhost:repositories/user/repo.git
.
2) Gitlab server generates tips how to push project to repo and there is not repositories/
in path. I mean it generates git@mygitlabhost:user/repo.git
instead of git@mygitlabhost:repositories/user/repo.git
which is correct.
3)当我尝试调试它时,我在服务器上的repo内打开了pre-receive
脚本,并尝试输出变量(其中有3个):refs = ARGF.read
,key_id = ENV['GL_ID']
和repo_path = Dir.pwd
,发现key_id始终为空.也许问题出在这里...如果是这样,请给我有关如何解决该问题的建议.谢谢
3) When i tried to debug it, I opened pre-receive
script inside repo on server and tried to output variables (there is 3 of them): refs = ARGF.read
, key_id = ENV['GL_ID']
and repo_path = Dir.pwd
and found, that key_id is always empty. Maybe the problem is here... If so, please give me suggestions on how to fix that. Thanks
推荐答案
似乎问题出在某些服务上,例如sidekiq.运行sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
会输出config的所有问题.
Seems the problem is with some services, like sidekiq. Running sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
outputs all the problems with config.
这篇关于Git Push错误预接收挂钩被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!