I changed my app name from "my-app-staging" to "my-app-staging-new" in the Heroku dashboard. Now I can no longer push changes to it- git throws the following error:
! No such app as my-app-staging.
fatal: Could not read from remote repository.
How do I resolve that?
Renaming an application It is possible to rename an application by using the heroku:rename command. The application becomes accessible by the new name immediately, and the old name should not be used anymore to address it.
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
You need to change your git remote.
If you do git remote -v
you should see heroku
listed.
It will look something like:
heroku [email protected]:my-app-staging.git (fetch)
heroku [email protected]:my-app-staging.git (push)
Delete that remote...
git remote rm heroku
...and then add the new one
git remote add heroku [email protected]:my-app-staging-new.git
First Delete the Old remote
$ git remote rm heroku
Then Add the New One:
$ heroku git:remote -a newname
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With