【问题标题】:how to delete heroku app and switch to the new app created from the same files?如何删除heroku应用程序并切换到从相同文件创建的新应用程序?
【发布时间】:2018-06-09 13:04:51
【问题描述】:
我正在使用 Heroku 工具带:
- 命令行:
>heroku create app1(根应用程序)
- 在浏览器中从 Heroku Dashboard 中删除 app1。
- 命令行:
>heroku create app2(来自同一个根应用程序)
-
我想添加变量:heroku config:set MYVAR=value
然后我得到错误:
Setting MYVAR and restarting app1... !
! Couldn't find that app.
如何切换到新应用 (app2) 并彻底移除 app1?
【问题讨论】:
标签:
heroku
command-line-interface
heroku-toolbelt
【解决方案1】:
-
打开您的仪表板并选择您要删除的应用程序。
-
现在您在所需的应用程序中单击“设置”选项卡。
-
滚动到页面底部并点击“删除应用程序...”按钮。
-
按照屏幕上的说明确认删除应用。
荣誉:- Google search top result
【解决方案2】:
使用 heroku git:remote 将 git 远程添加到应用程序仓库
用法
$ heroku git:remote
选项
-a, --app=app 要使用的 Heroku 应用
-r, --remote=远程创建 git 远程
--ssh-git 使用 SSH git 协议
描述
额外的参数将被传递给 git remote add
示例
将 git 远程 heroku 设置为 https://git.heroku.com/example.git
`$ heroku git:remote -a example`
将 git remote heroku-staging 设置为 https://git.heroku.com/example-staging.git
`$ heroku git:remote --remote heroku-staging -a example`
【解决方案3】:
heroku apps:destroy --app app1 --confirm app1
heroku git:remote -a app2
【解决方案4】:
您可以使用
将应用从 app1 更改为 app2
heroku git:remote -a app2
【解决方案5】:
尝试销毁旧应用:
heroku apps:destroy app1
请注意,这将永久且不可撤销地销毁app1。