10

I have been creating a GitHub project. Now I'm planning on hosting it on Heroku. It looks like Heroku creates a new git repository and expects me to use it for my project. How can I point Heroku at my existing repository?

Kevin
  • 14,655
  • 24
  • 74
  • 124

1 Answers1

21

you still need your github repository.

git remote add heroku {heroku repository path} 

will add another remote repository to your code, then

git remote

will list all your remotes, probably

-- origin
-- heroku

and then

git push {remote name} {branch name}

will push to the appropriate remote:

git push heroku master

will start your deployment

git push origin

or probably just

git push

will push your changes just on github

matteofigus
  • 960
  • 9
  • 11
  • 1
    I would clarify on what to do if the Heroku app already exists (as your answer assumes), or if you've yet to create it. In the latter case, `heroku create` will add the `heroku` remote for them. – catsby Nov 10 '13 at 15:34
  • Perfect explanation, thank you. – nerdburn Feb 10 '15 at 18:49