I should start by saying I'm totally new to Heroku, and it's all looking pretty to foreign to me right now.
Anyway, I've done the Heroku getting started tutorial, uploading a clone git repo, and this works fine.
I'm now trying to accomplish this with some of my own code, but struggling.
heroku create
. This is successful.git push heroku master
as instructed in the tutorial, and I receive the following errors: error: src refspec master does not match any.
error: failed to push some refs to 'heroku'
Would appreciate if someone can explain what I am missing here? Thanks in advance.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With