I\'m hosting on Heroku. I want to make a push:
git push master Heroku
I gets the message:
error: src refspec master does no
I experienced the same issue.
For me the problem occurred because I hadn't signed into git correctly.
Before you can push code to the master branch, you must have first made your initial commit with the command git commit -m "My first commit"
. You may have gotten this response when trying to do that (like I got):
git: fatal unable to auto-detect email address (got "some wrong email").
If that was the response you got, you must now enter your desired git email and username with the commands:
git config --global user.email "you@example.com"
git config --global user.name "Your Username"
After you've done that, try the push command again
git push heroku master
It should work now.
This is a late answer, but might help someone.
instead of this:
git push master Heroku
try:
git push heroku master
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
I have expericed the problem you have. I solved this problem like this
push
$ touch readme
$ git add .
$ git commit -m "init"
$ git push heroku master
I don't know why.
First push your changes to the remote branch before pushing to heroku
git push origin master
git push heroku master
If you want to push a branch which is not the master branch to heroku
git push origin development_branch
git push heroku development_branch:master
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.