Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overwriting an existing Heroku app

Tags:

I have a Sinatra app, hosted on Heroku. Lately, I've been developing that same app from a different folder. It's not a branch, it's just a parallel app / directory with identical contents but different code. I want to push this new app to Heroku, overwriting the app that's currently there. I don't want to merge the two locally, just continue from the new one while keeping the old. What's the proper command sequence for this? I have doubts about running heroku create, as that will result in a new app. Thanks!

like image 432
fullstackplus Avatar asked Jan 21 '13 11:01

fullstackplus


People also ask

Can you change the name of your Heroku app?

💡 You can rename a Heroku app at any time, but you may change your Git remote and public web address.

How do I use existing Heroku app?

Note: Heroku now describes it in the project overview: Navigate to dashboard.heroku.com, click your app, then switch to the "deploy" tab and choose the deployment method "Heroku git" (selected by default). Then, you'll get instructions on how to connect an existing folder/git with Heroku.

Can we edit code in Heroku?

You cant edit your files online and expect them to be in sync with your own repository , it defeats the purpose of using a vcs , as soon as you push an new version your online edited files will be deleted.


1 Answers

Firstly this is certainly possible. The process is quite simple, firstly we need to add Heroku as a new remote repository to your new app.

heroku git:remote -a project 

You would replace the 'project' with your Heroku app name. Secondly you would need to force a push to Heroku.

git push -f heroku master 

Note: We are using an '-f' to force the push.

like image 176
webjames Avatar answered Sep 28 '22 05:09

webjames