Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku: src refspec master does not match any

I'm hosting on Heroku. When I push:

git push master Heroku 

I get the error:

error: src refspec master does not match any. error: failed to push some refs to '[email protected]: etc ...' 
like image 208
Mark Avatar asked Oct 27 '14 20:10

Mark


People also ask

Why SRC Refspec does not match any?

The “src refspec master does not match any” error occurs if you have forgotten to add the files you have changed to a commit and try to push those changes to a remote repository before you make the first commit in your repository.

How do I push a branch to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.


2 Answers

This is work for me:-

git push heroku HEAD:master 
like image 142
vineet Avatar answered Sep 18 '22 14:09

vineet


I have experienced the problem. I solved this problem like this

  1. make file whatever

  2. commit

  3. push

     $ touch readme   $ git add .   $ git commit -m "init"   $ git push heroku master 

I don't know why.

like image 37
jijijijiji Avatar answered Sep 19 '22 14:09

jijijijiji