Heroku – How to attach the repo to heroku app

heroku

I create a heroku app and then my machine crashed. I have a new machine. How do I attach my existing app to heroku app. When I visit heroku page the url for my app is like this

git@heroku.com:myapp.git

I can't do clone this app because I already have myapp from github. So I need to add heroku as remote to my existing github app. Anyone knows the syntax.

Best Answer

If you've heroku toolbelt:

If you're using the Heroku Toolbelt, the newer syntax is

heroku git:remote -a project

See this for more.

Credits: user101289's solution

Else if you don't have heroku toolbelt:

First do this:

git remote add heroku git@heroku.com:{heroku-app-name}.git

Then do this:

git push heroku master
heroku open