5

I'm having trouble pushing master to Heroku to deploy my Heroku app.

When I type in this code:

git push heroku master

I get this error:

error: src refspec master does not match any.
error: failed to push some refs to 'git@heroku.com:evening-scrubland-91960.git'

Where git@heroku.com:evening-scrubland-91960.git is the name of my app.

If it helps, I'm using this website as a tutorial: https://devcenter.heroku.com/articles/getting-started-with-python#deploy-the-app

I've also used the following suggestions from the below website: I want make push and get error: src refspec master does not match any

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135

3 Answers3

19

You may also get the above error, if you are you still using "master" instead of "main".

Instead of: "git push heroku master"

Try: "git push heroku main"

  • This is just guessing of branch naming convention. It's official for github but git and github are completely different things – GTsvetanov Jan 08 '21 at 20:10
  • @GTsvetanov heroku also changed master to main. so, this answer works for tens of people including me :) – marmeladze Sep 07 '21 at 13:00
4

The log tells you everything: src refspec master does not match any means that there is nothing committed on master branch yet.

Be sure, that you have staged your changes using the git add command and committed them using the git commit command before pushing them to the remote.

lut
  • 130
  • 1
  • 9
1

Resolving possible errors, such as: Error: spawn cmd ENOENT, Code: ENOENT,H10 no modulError

Go to the heroku site, create a new application. Done this, open command prompt administrator mode on your pc, just click with right button. It will open the command screen, in front of this, activate your k39 or k3X.com

activate k39

After:

heroku login

Validate the token on the heroku page, just click. No cmd change to project director.

cd C:\Users\Lancaster\PycharmProjects\ 

Put the address where the project is on your pc, do not put the example. Once that's done, the first time you're submitting the project, do:

git init

git config --global user.email "email@email"

git config --global user.name "nameapp"

heroku git:remote -a nameapp

Now add these commands, always when updating your page.

git add .
git commit -am "make it better"
git push heroku master

If you have a secondary page that is, you created more than one app or it is not the root or give an error in the final command, claiming not to be the master.

git push heroku

After that, the submission will occur normally.