Pushing a non-master branch to Heroku

Posted on

I completed a React project with a Rails API backend. Locally everything worked prefectly.  When trying to change environment variables like the address of the API backend, I wanted to create a seperate branch for heroku, it case I needed to edit something for heroku. I would rather not clutter “master” with changes until they are 100% working.

Problem is heroku only recognizes master branches, but to test I need to commit to master

Well there is a work aorund, just push a different branch up to heroku manually


git push heroku [name-of-your-branch]:master

this way I can push up a branch I named heroku up to heroku.

Credit: link from Jordon Trevino

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s