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
  • 159,198
  • 144
  • 384
  • 498
  • 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

3 Answers3

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,164
  • 2
  • 30
  • 39
2

First Delete the Old remote

$ git remote rm heroku

Then Add the New One:

$ heroku git:remote -a newname

Ahmedakhtar11
  • 506
  • 5
  • 6
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
  • 61
  • 6