git - How do I push different branches to different heroku apps? -
i've been working on web-app gets pushed heroku. source hosted on github.
so git push pushes master branch guthub.
my git branch 'master' connected heroku app 'my-app-staging'
so git push heroku pushes app my-app-staging.herokuapp.com
i've created new heroku app 'production' app, let's call 'my-app-prod'.
i have created branch called 'production' (ie git checkout -b production) , i've run git push -u origin production make managed branch @ github.
i want link production branch my-app-prod.herokuapp.com such that, when switched production branch can type git push heroku (or perhaps git push prod-heroku production or similar) , voila - production branch pushed production app.
what's recommended way link production branch my-app-prod on heroku?
i've wallowed through heroku's own docs on this assume i've set apps using heroku create cli, not set apps via heroku's website, following paragraph makes head spin:
it’s simple type
git push staging master,git push production masterwhen you’ve followed steps above. many developers take advantage of git’s branches separate in-progress , production-ready code, however. in sort of setup, might deploy production master branch, merging in changes development branch once they’ve been reviewed on staging app. setup, pushing littler trickier:
where want end follows:
- in branch
master: (a)git pushpushes code github, , (b)git push herokupushes codemy-app-stagingon heroku - in branch
production: (c)git pushpushes codeproductionbranch on github, , (d)git push herokupushesproductioncodemy-app-prodon heroku.
given step 1 above in place , step 2 (c) in place, how achieve step 2 (d)?
you should add remote my-app-prod named prod-heroku (replace git_url git url can find in settings page of my-app-prod in heroku):
git remote add prod-heroku git_url git push prod-heroku production:master this push local branch production remote branch master in prod-heroku my-app-prod deployed code in production branch.
Comments
Post a Comment