【问题标题】:Can't git push with error " master (pre-receive hook declined)"无法 git push 并出现错误“master (pre-receive hook denied)”
【发布时间】:2014-07-18 11:28:00
【问题描述】:

我将 Tomcat 7 作为墨盒并按照此处给出的步骤进行操作 - https://www.openshift.com/kb/kb-e1088-how-to-deploy-pre-compiled-java-applications-war-and-ear-files-onto-your-openshift-gear

但是,推送更改的最后一步失败,反复失败。

Vivek N@ACCOUNTINVALID ~/root (master)
$ git push --verbose
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Pushing to ssh://53c810bf5973ca46e70000a1@mailbostonisa-bisa.rhcloud.com/~/git/m
ailbostonisa.git/
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 20.69 MiB | 11.30 MiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: OPENSHIFT_DEPLOYMENT_TYPE is 'binary' - git-based deployments are disabl
ed.
To ssh://53c810bf5973ca46e70000a1@mailbostonisa-bisa.rhcloud.com/~/git/mailbosto
nisa.git/
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://53c810bf5973ca46e70000a1@mailbostonisa
-bisa.rhcloud.com/~/git/mailbostonisa.git/'

请帮忙提出建议

【问题讨论】:

标签: git openshift push


【解决方案1】:

git pre-receive hook 是一个脚本,每次收到推送时都会在服务器端运行。此错误意味着他们的服务器拒绝了您的提交。不幸的是,您收到的错误信息不是很丰富。如果您有权访问服务器,请查看 ./.git/hooks/pre-receive 并确认它没有任何检查您的代码失败。您可以查看http://git-scm.com/book/en/Customizing-Git-Git-Hooks 了解更多关于 git hooks 的信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-27
    • 1970-01-01
    • 1970-01-01
    • 2014-02-26
    相关资源
    最近更新 更多