如何删除heroku应用程序并切换到从相同文件创建的新应用程序?

时间:2017-12-29 02:27:18

标签: heroku command-line-interface heroku-toolbelt

我正在使用Heroku toolbelt:

  1. 命令行:>heroku create app1(根应用程序)
  2. 在浏览器中从Heroku信息中心删除app1。
  3. 命令行:>heroku create app2(来自同一个根应用程序)
  4. 我想添加变量:heroku config:set MYVAR=value

    然后我收到错误:

    Setting MYVAR and restarting app1... !
     !    Couldn't find that app.
    
  5. 如何切换到新应用(app2)并完全删除app1?

4 个答案:

答案 0 :(得分:8)

尝试销毁旧应用:

heroku apps:destroy app1

请注意,这将永久且不可挽回地销毁 app1

答案 1 :(得分:1)

 heroku apps:destroy --app app1 --confirm app1

 heroku git:remote -a app2

答案 2 :(得分:0)

您可以使用

将应用程序从app1更改为app2。
heroku git:remote -a app2

答案 3 :(得分:0)

使用 heroku git:remote 将 git remote 添加到应用程序仓库

用法

$ heroku git:remote

选项

-a, --app=app 要使用的 Heroku 应用程序

-r, --remote=remote 要创建的 git 远程

--ssh-git 使用 SSH git 协议

描述 额外的参数将被传递给 git remote add

示例

将 git remote 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`
相关问题