You will need to add two remotes within the same project.
Initiate your project for Git
$ git init
To add Github remote to your project and push:
$ git remote add origin https://github.com/user/repo.git
# Set a new remote
$ git remote -v
# Verify new remote
# origin https://github.com/user/repo.git (fetch)
# origin https://github.com/user/repo.git (push)
$ git add .
$ git commit -m "initial commit"
$ git push origin master
To create a new Heroku project and push the remote to your project:
$ heroku create
$ git remote -v
# Verify new remote (you will see heroku and origin now
# heroku [email protected]:falling-wind-1624.git (fetch)
# heroku [email protected]:falling-wind-1624.git (push)
# origin https://github.com/user/repo.git (fetch)
# origin https://github.com/user/repo.git (push)
$ git push heroku master
This is a standard strategy which you will everytime want to git add, commit, and then push to both origin master
(Github) and heroku master
(Heroku).