Yarin
Yarin

Reputation: 183599

Git push failing after Heroku app name change

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?

Upvotes: 9

Views: 4896

Answers (4)

pyfyc
pyfyc

Reputation: 157

Note that now you need to specify your heroku app name in a slightly different format:

git remote add heroku https://git.heroku.com/your-app-name.git

You can see it in your heroku dashboard settings at: Heroku git URL

Upvotes: 0

Ahmedakhtar11
Ahmedakhtar11

Reputation: 1458

First Delete the Old remote

$ git remote rm heroku

Then Add the New One:

$ heroku git:remote -a newname

Upvotes: 2

pypie
pypie

Reputation: 71

First

git remote rm heroku

to remove the old remote. Then

git remote add heroku [email protected]:new-app-name.git

to add the new remote. Finally

heroku keys:add

to set a public ssh key.

Upvotes: 0

jordelver
jordelver

Reputation: 8432

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

Upvotes: 26

Related Questions