简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM