How to attach my repo to heroku app

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

[email protected]: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.


Solution 1:

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 [email protected]:{heroku-app-name}.git

Then do this:

git push heroku master
heroku open

Solution 2:

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

heroku git:remote -a project

See this for more.