Push to Heroku denied - "failed to push some refs to 'heroku" Push to Heroku denied - "failed to push some refs to 'heroku" heroku heroku

Push to Heroku denied - "failed to push some refs to 'heroku"


It seems that you have not initiated your master branch properly. Have you commited your files? Try (assuming you are on master branch):

git add .git commit -m "First commit"git push heroku master:master

Another, more direct approach, is to push the HEAD:

git push heroku HEAD:master


If you're getting this: error: src refspec master does not match any when attempting to push to heroku master, then you might have to change

git push heroku master to git push heroku main.

(Assuming this project already existed and you had previously pushed it to heroku master).

This is due to a recent update made to git where the term master was changed to main. I had the same issue and this worked for my case.


I was working on this for the past 3 hours and now i get it clearly.all you need to do is init with whatever project and all i did it "npm init"