How to set up heroku for a non-master branch as test and then merge it into master?

非 Y 不嫁゛ 提交于 2019-12-24 22:39:03

问题


Why

I'm fairly new to rails and this particular project is the first where I'm working collaboratively on a rails app.

Therefore I wanted to test-deploy the existing app on heroku and when it's working merge into master. This is because I don't want to mess with master until I know what I'm doing (read: heroku works).

The problems I can foresee

Heroku is fairly attached to work with master only, unless specified. This SO question documents how to deploy a non-master branch but does not go into detail what happens when this branch is then merged into master.

Does it mess up the configuration or will it work just fine and accept master as the new deployed branch? If not, what do I have to change once I merge into master?


回答1:


The process should be:

Create a new branch:

git branch test
git checkout test

Make changes, commit

git commit -a -m 'added a new test feature'

Push test branch to heroku

git push heroku-dev test:master

If everything works, merge the test branch

git checkout master
git merge test

Push master

git push heroku-dev master

I do this all the time and nothing wrong happens.



来源:https://stackoverflow.com/questions/52136230/how-to-set-up-heroku-for-a-non-master-branch-as-test-and-then-merge-it-into-mast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!