getting the error ! master -> master (pre-receive hook declined)

I am not able to git push heroku master anymore

I get the following error (after the bundle install and assets precompile step that looks like had no problem)

The error is the following:

remote: Verifying deploy............................
remote: !   Push rejected to my-project.
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ''

An idea what can be causing this ? Is it in the heroku side or git side ? (I am using bitbucket)


  • how do I deploy multiple branches to different directories via git push?
  • Cannot push to github, ssh: Could not resolve hostname
  • Longer Filenames with git merge
  • (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1 (Psych::SyntaxError)
  • Setting up Rails project on localhost, postgresql issue
  • Unable to push to heroku master because of rails/spring version error
  • How can I print my git tags in Capistrano as part of my deploy task?
  • Rails Capistrano - SSHKit::Command::Failed: bundle exit status: 16
  • 2 Solutions collect form web for “getting the error ! master -> master (pre-receive hook declined)”

    I faced a similar issue while deploying to heroku. The most probable cause is that there is an error in you source code. Scroll up the transcript generated(from which you have copied the mentioned message)
    I found: “

    remote:        rake aborted!
    remote:        NameError: undefined local variable or method `heroRails' for main:Object"

    because of a typing error.
    After correcting the source code commit and push.
    ‘git push heroku master’ will run and deploy succesfully.

    As the error message suggests (pre-receive hook declined), the server you are pushing to has a pre-receive hook, i.e. a script that is ran before the push is completed to check some well-formedness properties. Your code does not satisfy these.

    Search “heroku pre-receive hook” on SO or your favorite search engine to find issues that may cause this.

    Git Baby is a git and github fan, let's start git clone.