Push to Heroku denied - “failed to push some refs to 'heroku”

大憨熊 提交于 2020-01-24 06:05:14

问题


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.

  1. First, I go to my app directory in bash.
  2. Then I run heroku create. This is successful.
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!