9

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?

Yarin
  • 173,523
  • 149
  • 402
  • 512
  • possible duplicate of [renamed heroku app from website, now it's not found](http://stackoverflow.com/questions/7615807/renamed-heroku-app-from-website-now-its-not-found) – Yarin Feb 21 '14 at 18:17

4 Answers4

26

You need to change your git remote.

If you do git remote -v you should see heroku listed.

It will look something like:

heroku git@github.com:my-app-staging.git (fetch)
heroku git@github.com:my-app-staging.git (push)

Delete that remote...

git remote rm heroku

...and then add the new one

git remote add heroku git@heroku.com:my-app-staging-new.git

jordelver
  • 8,292
  • 2
  • 32
  • 40
2

First Delete the Old remote

$ git remote rm heroku

Then Add the New One:

$ heroku git:remote -a newname

Ahmedakhtar11
  • 1,076
  • 11
  • 7
0

First

git remote rm heroku

to remove the old remote. Then

git remote add heroku git@heroku.com:new-app-name.git

to add the new remote. Finally

heroku keys:add

to set a public ssh key.

pypie
  • 71
  • 6
0

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

pyfyc
  • 127
  • 2
  • 9