Push local non-master branch to Heroku

So I was in the process of upgrading my app to Rails 5 (link1, link2), and wanted to push it to my staging app on heroku. I created a new git local branch called Rails5 to do the upgrade locally. The I kept running git push staging3 master to try to push it to heroku, but when I ran heroku run rails --version --remote staging3 to check the version of rails on heroku, I could see it wasn’t updating. By default heroku only pushes the master branch. You have to run a special command to push a different local branch to the remote heroku master branch. Essentially heroku only has a master branch – so you need to push your non-master local branch to the heroku master branch. Apparently I didn’t know this key command on how to push a non-master branch to heroku:

git push heroku yourbranch:master

see heroku article here

Here’s two other helpful links (link1link2) for upgrading to rails 5

Advertisements