Home > Back-end >  Cannot push to Heroku main
Cannot push to Heroku main

Time:12-09

I'm trying to deploy using Heroku. When pushing my code to Heroku git through its HTTPS URL, I see an error like this

git push heroku main fatal: unable to access 'https://mfal-project.herokuapp.com/': The requested URL returned error: 502

I already removed Heroku and added a new Heroku but it still didn't work. You can look at the photo I've enclosed. Can anyone help me?

Here are my practice project github https://github.com/leeonmark/restapi.git

CodePudding user response:

You're trying to use the address where your app is hosted as a Git remote:

https://mfal-project.herokuapp.com/

But the address where your app is hosted and the address its Git service uses are different.

Instead of adding the remote manually, I suggest you remove the existing one using git remote rm heroku and then ask the Heroku CLI to add a remote for you:

heroku git:remote -a mfal-project

You should now see a new remote called heroku that looks more like

https://git.heroku.com/mfal-project.git
  • Related