Skip to content

Instantly share code, notes, and snippets.

@xaxim
Created March 4, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xaxim/1713542e230e9bc5a3f2 to your computer and use it in GitHub Desktop.
Save xaxim/1713542e230e9bc5a3f2 to your computer and use it in GitHub Desktop.
Renaming heroku app name
https://devcenter.heroku.com/articles/renaming-apps#updating-git-remotes
You can rename an app at any time with the heroku apps:rename command. For example, to rename an app named “oldname” to “newname”, change into the app’s git checkout and run:
$ heroku apps:rename newname
Renaming oldname to newname... done
http://newname.herokuapp.com/ | git@herokuapp.com:newname.git
Git remote heroku updated
Renaming an app will cause it to immediately become available at the new subdomain (newname.herokuapp.com) and unavailable at the old name (oldname.herokuapp.com).
If you have custom domains configured that use these subdomains, for example a CNAME record set up that references oldname.herokuapp.com, then it will also need to be updated.
Renaming without a checkout
You can rename an app while outside a git checkout by passing an explicit --app argument:
$ heroku apps:rename newname --app oldname
http://newname.herokuapp.com/ | git@herokuapp.com:newname.git
Note that you will need to manually update any existing git remotes that point to the old name.
Updating Git remotes
If you are using the CLI to rename an app from inside the Git checkout directory, your remote will be updated automatically. If you rename from the website or have other checkouts, such as those belonging to other developers, these will need to be updated manually:
$ git remote rm heroku
$ heroku git:remote -a newname
Replace “newname” with the new name of the app, as specified in the rename command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment