It took me a bit longer to figure this out than I thought it should, so I’m documenting it. If you need to push a local branch to a remote different branch, do this:

$ git push remote local_branch:remote_branch

A real world example: when pushing to our heroku based staging environment, I need to push my local staging branch to the remote master (since heroku will only deploy the master branch), I do this:

$ git push heroku_staging staging:master