git, Heroku: pre-receive hook declined git, Heroku: pre-receive hook declined ruby ruby

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.


Make sure that you are using either npm or yarn.lock file-

Two different lockfiles found: package-lock.json and yarn.lock Both npm and yarn have created lockfiles for this application, but only one can be used to install dependencies.

After deleting yarn.lock and pushing the code again to git, my issue resolved.


I faced the same problem:

! [remote rejected] vX.X.XX -> master (pre-receive hook declined) error: failed to push some refs to 'git@heroku.com:[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