What's the correct way to rename a heroku app?
Asked Answered
G

9

60

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?

Genius answered 4/1, 2013 at 16:37 Comment(0)
M
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.

Mureil answered 10/11, 2014 at 16:25 Comment(1)
This is a better answer with more complete information and a link backing it upBeirut
S
68

Did you try heroku apps:rename NEWNAME?

Supposition answered 4/1, 2013 at 17:9 Comment(2)
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 <newurl>. You can get the new URL from the web interface.Supposition
@un5t0ppab13: Not required, just wanted to make it more clear that it was a variable piece of data.Supposition
M
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.

Mureil answered 10/11, 2014 at 16:25 Comment(1)
This is a better answer with more complete information and a link backing it upBeirut
H
14

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

^ worked for me

Hardcastle answered 18/3, 2016 at 4:15 Comment(1)
important for those of us who have more than one heroku deployment linked to a repoInfielder
R
4

Use this:

heroku apps:rename --app old_name new_name
Riparian answered 27/8, 2018 at 17:35 Comment(1)
This is the updated Heroku command to rename the name of the app.Procrastinate
C
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

Cad answered 13/2, 2019 at 12:3 Comment(1)
heroku git:remote -a newname will overwrite the existing heroku remote, therefore, git remote rm heroku is not needed.Afghan
C
3

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
Coacervate answered 2/5, 2022 at 16:27 Comment(0)
S
2

Try this command:

heroku rename new_app_name
Skinner answered 10/9, 2013 at 17:34 Comment(0)
P
2
heroku rename new-name-app

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

Puppy answered 9/5, 2016 at 21:53 Comment(0)
B
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

Butyl answered 18/9, 2020 at 10:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.