Git推送错误预接收挂钩被拒绝 [英] Git push error pre-receive hook declined
问题描述
我已经在虚拟机上运行了 gitlabhq rails 服务器,按照本教程中的 1-6 个步骤进行操作 https://github.com/gitlabhq/gitlab-recipes/blob/master/install/centos/README.md 并启动 rails server 执行命令 sudo -u git -H bundle exec railss -e 生产
.之后,我使用管理工具创建了用户并在该用户下创建了新项目.然后我试图将现有项目一如既往地推送到这个 repo.但在最后一步,git push origin master
失败并出现错误
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 denied] master -> master (pre-receive hook denied)
[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 服务器生成提示如何将项目推送到 repo 并且路径中没有 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
输出所有配置问题.
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推送错误预接收挂钩被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!