问题
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.
- First, I go to my app directory in bash.
- Then I run
heroku create
. This is successful. - I then run
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.
回答1:
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
来源:https://stackoverflow.com/questions/40331282/push-to-heroku-denied-failed-to-push-some-refs-to-heroku