将新的 repo 推送到现有的 Heroku 应用程序并覆盖那里的内容

Push a new repo to an existing Heroku app and overwrite what is there

大约 3 个月前,我已经向 Heroku 部署了一个 Rails 6 应用程序。在我创建应用程序时,这只是一个临时网站。现在我想将新应用程序推送到现有的 Heroku 应用程序并覆盖已经存在的任何内容,包括新数据库。我怎么做?该代码在本地的不同 repo 中。

嗨,您可以执行以下操作:

  • 在你的新项目中添加 heroku 作为你的遥控器
  • git push --force heroku master
  • 连接到 heroku 上的 Web 控制台,删除数据库并 recreate-it。

但是,删除现有应用程序并重新创建它更简单。