I am trying to update the stack of an old app that's been running on Heroku after making some minor modifications to the code. I cloned the app onto my local (a new Windows laptop that did not previously have Heroku installed). made the modifications and committed/pushed successfully back to the Github repo. At this point I logged on to my Heroku account and noticed that the stack was out of date and needed to be updated to Heroku-20. I first installed heroku on the new machine using my Git Bash inside the directory for my app (barbershop) on the (master) branch:
$ npm install -g heroku
I then logged into my heroku account:
$ heroku login
Next I tried to add the heroku remote
$ heroku git:remote -a barbershop
I then tried to update the stack:
$ heroku stack:set heroku-20 -a barbershop
Finally, I wanted to push the committed code to the new stack as directed to trigger a new build for the changes to take effect:
$ git push heroku main
I get an error message error: src refspec main does not match any error: failed to push some refs to 'https://git.heroku.com/barbershop.git
*Note: This is not the actual url, just a dummy example, but the issue/error is real.
What am I doing wrong here. I read that this was an API enpoint bug that was fixed for free accounts a while back. Did I do something incorrectly here? How can I resolve this issue?