git, Heroku: pre-receive hook declined

I am in the process of setting up a git repository and attempting to link it to Heroku. When I run the command

git push heroku master

I receive

  • Non-web based code review tool
  • Mylyn commit default message missing
  • removing or changing from the origin branch in git
  • Images corrupt after git push
  • Add images to on GitHub
  • Automate Git merge in continuous integration but fail if there are merge conflicts
  • Counting objects: 7, done.
    Delta compression using up to 2 threads.
    Compressing objects: 100% (5/5), done.
    Writing objects: 100% (7/7), 714 bytes, done.
    Total 7 (delta 1), reused 0 (delta 0)
    -----> Heroku receiving push
     !     Heroku push rejected due to an unrecognized error.
     !     We've been notified, see if the problem persists.
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to ''

    I’m not quite sure what other information would be helpful and what will just muddy the waters, so I’ll just leave it at this for now. Any help getting my application pushed to Heroku would be greatly appreciated. Thanks.

  • Git Branch newbie - How to reverse?
  • Pull Master from featured branch
  • Git alternative to sending out tarballs and asking patches be sent back for a sub-project?
  • Install and use git with Ruby
  • Having multiple eclipse project in one Github repository
  • How to recover after i execute :git reset --hard HEAD
  • 6 Solutions collect form web for “git, Heroku: pre-receive hook declined”

    Make sure you are pushing a repo that contains a proper supported app ( Rails, Django etc.) and you are not just pushing some random repo to test it out.

    Newbie in Heroku: Error when push my app to Heroku

    If that is not the case and you are pushing what you think is a valid app, contact Heroku support and they will fix it for you.

    I faced the same problem:

    ! [remote rejected] vX.X.XX -> master (pre-receive hook declined) 
    error: failed to push some refs to '[application-name]'

    I realized that my heroku application Stack is ‘cedar-10’ and was deprecated from 04/11/2014 and disabled from 04/11/2015 (Cedar-14 is now Generally Available).

    The solution was to upgrade the heroku application Stack following the guide:

    Upgrading the production app to Cedar-14

    I had the same problem but with a Django app, it turned out that pip wasn’t able to download/install one of the dependencies of the requirements.txt file (it was eyeD3)

    Another issue could be that in a production environment, you can’t use sqlite3, the default database when you make a rails app.

    In order to fix this, just change the database your rails app uses to Postgres. This can easily be accomplished by editing your Gemfile

    From your Gemfile, remove:

    gem sqlite3;

    and add the following:

    group :development, :test do
      gem 'sqlite3'
    group :production do
      gem 'pg'

    In case someone makes the same dumb mistake I did…

    If you have an error in your css this error can also show up.

    In one of my media queries I put

    @media screen adn (min-width: 1000px) {

    Instead of the “and” which gave me this error.

    A good indicator that this may be the case is if you get an error that contains the message

    "Tasks: TOP => assets:precompile ... Precompiling assets failed" 

    That was my first clue to look in my css.

    Hope this helps someone!

    A little late to the game, one of my issues was I had an outdated sshkey. Just need to update that in the settings.

    Another thing was I was pushing Python Django CMS, and it was running python collectstatic during deploy and it was failing. So make sure you check the log heroku log --tail. That gave me another hint to turn off collectstatic, it event tells you what to type to turn it off.

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