Search code examples
ruby-on-railsgitheroku

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


I have deployed a Rails 6 app to Heroku about 3 months ago. This was just a temporary website whilst I was creating the app. Now I want to push the new app to the existing Heroku app and overwrite whatever is already there, including a new database. How do I do that? The code is in a different repo locally.


Solution

  • HI you can do the following:

    • Add heroku as your remote on your new project
    • git push --force heroku master
    • connect to web console on heroku, drop database and recreate-it.

    However, deleting the existing application and recreating it is simpler.