Error deploying to Heroku - src refspec 'refs/heads/master' does not match any existing object

I’m getting this error trying to deploy to Heroku

I get a message that it was deployed successfully but when I go to the live site there’s nothing there.

Seems like your master branch is probably renamed to main. But not on the remote.

Not sure what I did but it was working for a while. Now I’m getting two errors…

and

I found this on Stack Overflow:

git push heroku HEAD:master

I did that with HEAD:main and it published the site with no errors.