Search code examples
ruby-on-railsrubyherokudeploymentgit-push

How can I stop my second app deploying to the URL in Heroku?


I'm simultaneously working on two different Ruby on Rails apps and deploying to Heroku. However, when I try to push the 2nd app to heroku, it overwrites the first one. How can I stop this from happening?

I've gone through the different stages:

git init  git add . git commit -m "insert comment" git push heroku master 

the same as I did for the first one. What steps am I missing out?


Solution

  • 'heroku' is just a name for your remote Heroku repository. If you are pushing two different git histories from different directories and they are overwriting one another on the URL, then they are pointing at the same remote.

    Try running git remote -v from the root directory of each app. If that command returns same URL each time, then that's the issue.

    Assuming this is true:

    Pick one app and remove the remote with git remote remove heroku. Then create a new remote with heroku create new_shiny_app. Push your code to that remote and you're back in business.