I'm hosting on Heroku. I want to make a push:
git push master Heroku
I gets the message:
error: src refspec master does not match any.
error: failed to push some refs to 'git@heroku.com: etc ...'
I'm hosting on Heroku. I want to make a push:
git push master Heroku
I gets the message:
error: src refspec master does not match any.
error: failed to push some refs to 'git@heroku.com: etc ...'
This is a late answer, but might help someone.
instead of this:
try:
Come in late but in my case:
git push git@heroku.com:appname.git master
did the trick for me! With appname being the name of your heroku app
In my case, this happened because I had nothing to push. I had forgotten to do a "git add" first. As soon as I did a "git add" then "git commit" for actual content, the push worked fine.
actually, i needed to create a file, otherwise commit was empty.
I came here after following the step-by-step guide of heroku. To me the problem was solved after creating minimum a file in the repository, committing it and then pushing to heroku again.
At first glance it looks like you have got your
master
andHeroku
parameters round the wrong way because the first parameter togit push
should be the name of the remote repository, the second is refspec (normally a branch). You are more likely to have a branch calledmaster
and a remote calledHeroku
. But I would expect you to get a different error message if that were the case, something like:The error message you are seeing implies that there is no local
master
branch. That would be the case if you haven't made any commits yet because git doesn't create the branch until the first commit. You can check this by running:You should see a line containing
refs/heads/master
if you have a master branch. If not then try running:You can also find out what remotes you have available with:
If you have a remote called Heroku you should see something like: