Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push failing after Heroku app name change

Tags:

git

heroku

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?

like image 416
Yarin Avatar asked Feb 21 '14 17:02

Yarin


People also ask

Can you change the name of your heroku app?

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.

How do I push to GitHub after pushing to heroku?

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.


2 Answers

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

like image 103
jordelver Avatar answered Oct 02 '22 12:10

jordelver


First Delete the Old remote

$ git remote rm heroku

Then Add the New One:

$ heroku git:remote -a newname

like image 37
Ahmedakhtar11 Avatar answered Oct 02 '22 13:10

Ahmedakhtar11