Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.
Add a remote for your staging app and deploy; note that on Heroku, you must always use master as the
If you want to deploy a different branch, you can use the syntax below (in this example, we push the
$ git remote add staging https://git.heroku.com/staging-app.git $ git push staging staging:master
$ git push staging staging:master -f
$ git remote add heroku https://git.heroku.com/app.git $ git push heroku master
$ git remote -v
$ heroku git:remote -a staging-app $ git remote rename heroku staging
As @Saworieza points out, all of the examples above use the https protocol for connecting to the remotes,
$ git remote add staging [email protected]:staging-app.git $ git remote add heroku [email protected]:app.git
If you have already created https remotes and want to switch them to use ssh, the following command can be used
$ git remote set-url staging [email protected]:staging-app.git

Thanks for the gist! Quick question tho, when I do that and then
git push heroku masternothing is pushed toheroku:masterand the build threfore fail, what step I am missing here ?