Changing heroku repo for pre-existing app

I created a heroku repo some time ago for my rails app but deleted it because I was never using it. Now I have come to the point where I need to use heroku but I am encountering the following error:

! No such app as furious-mist-2295. which was the old repo name, so it is clearly not pushing to the new stack I created.

  • Subdirectories in checked out directory of a previous revision not disappearing in Git?
  • Automatically wrap long Git commit messages in Vim
  • Git: How to clone the first commit?
  • “simple” vs “current” push.default in git for decentralized workflow
  • Heroku push fails to compile. Error points to node-sass. Possible dependency mismatch, log included
  • Looking for the best practice with SVN / GIT for Magento projects
  • This is what I was considering trying, but am concerned about causing unnecessary changes to my git repo.

    git remote rm origin

    git remote add origin <URL to new heroku app>

    git push -u origin master

  • Change the root directory of a Git repository
  • How to stop merging in git?
  • Reset git proxy to default configuration
  • Git issues with Laravel Forge
  • How to preserve --no-ff merges after a rebase
  • How to make git grep show at the top instead of the bottom of the terminal screen?
  • One Solution collect form web for “Changing heroku repo for pre-existing app”

    Turns out it can be done with the following commands

    git remote rm heroku

    git remote add heroku git@heroku.com:new-application.git

    Which is quite a simple little fix. Seemed rather difficult without knowing beforehand that these commands existed.

    git remote -v came in handy to double check which repos in git and heroku were being pushed and fetched.

    Git Baby is a git and github fan, let's start git clone.