59

Doesn't seem to be a way to do it from the command line, and when I do this from the site, I run into this issue when I try to git push heroku master:

 !  No such app as [previous app name].

Is this as simple as changing how I point to the app in git?

fox
  • 15,428
  • 20
  • 55
  • 85

9 Answers9

68

Did you try heroku apps:rename NEWNAME?

mipadi
  • 398,885
  • 90
  • 523
  • 479
  • 38
    If you already changed it via the web interface, you just need to update the heroku remote's URL, which you can do with `git remote set-url heroku `. You can get the new URL from the web interface. – mipadi Jan 04 '13 at 17:36
  • 5
    @un5t0ppab13: Not required, just wanted to make it more clear that it was a variable piece of data. – mipadi Nov 10 '14 at 18:44
58

Why use all caps?

heroku apps:rename my_new_app_name

Here is a great place to find out more:

How to rename your Heroku application

In case anyone is curious this method does not require any further configuration, your modifications should be immediate. At the time of this writing I was able to change the name of my app in seconds, and then do so again if I wished. Hope this helps.

jasonleonhard
  • 12,047
  • 89
  • 66
14

heroku apps:rename new_name --app old-app-name

^ worked for me

Anthony
  • 13,434
  • 14
  • 60
  • 80
4

If you are changing the name of the app on the webpage you should Updating Git remotes

git remote rm heroku heroku git:remote -a newname

https://devcenter.heroku.com/articles/renaming-apps

  • `heroku git:remote -a newname` will overwrite the existing `heroku` remote, therefore, `git remote rm heroku` is not needed. – bmdelacruz May 11 '19 at 13:09
3

Use this:

heroku apps:rename --app old_name new_name
Federico Grandi
  • 6,785
  • 5
  • 30
  • 50
2

Try this command:

heroku rename new_app_name
user247702
  • 23,641
  • 15
  • 110
  • 157
2
heroku rename new-name-app

always works for me but for additional information on rules, follow this page.

Nirupa
  • 787
  • 1
  • 8
  • 20
2

to rename app use:

heroku apps:rename --app <old_name> <new_name>

then, remove remote heroku:

git remote rm heroku

and add new one:

heroku git:remote -a <new_name>

and push changes:

git push heroku <branch_name>:main
Vova
  • 3,117
  • 2
  • 15
  • 23
1

If you want to rename your heroku app use: heroku apps:rename new_name

Please replace "new_name" with the name you want to give your app. make sure you do not include any "https://" because this will give you an issue. simply replace new_name with your app name

e.g heroku apps:rename grapefruitblog

After doing this, heroku requires that you update git remotes for all other local checkouts of the app. you can do this by running this command: heroku git:remote -a new_name

Again, replace new_name with the name you previously put in

e.g heroku git:remote -a grapefruitblog

Dharman
  • 30,962
  • 25
  • 85
  • 135