If you are getting this error when you try to push a git to heroku:

$ git push heroku main
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/app-name.git'

Solution:

Instead of this command: git push heroku main

Try: git push heroku master

 

Tip: you can also view your refs: $ git show-ref