Once we have multiple environments on Heroku for our application, we will need to learn how to push the same application code up to each different environment. This can be easily accomplished by adding additional git remotes on our machine. A Git remote is the location where Git pushes code to from our local machine. We can set up as many remotes as we like. It's common to have remotes for production, staging, and origin (most likely, GitHub or BitBucket).
When we push code to Heroku, the command typically looks like this:
$ git push heroku master
The name of the git remote that we're pushing to is heroku
. We can change the name and destination of our remotes to anything we want. By default, Heroku sets up a remote named "heroku" for our application. In this recipe, you will learn how to add additional remotes so that you can push the same code to multiple Heroku applications.