With Git feature branch workflow, when do you update the master branch?

拜拜、爱过 提交于 2019-12-07 13:20:15

问题


I'm fairly new to git and Jenkins. We want to use Jenkins and follow the feature-branch-workflow concept, which I believe is similar to the GitHub flow.

I'm aware that the master branch should always be what's currently deployed in production, but then when should the master branch be updated? It seems like there are two choices:

  1. BEFORE deploying to production: A pull request gets approved and the successful merge with master triggers the build, deployment to a staging environment, QA testing, and then someone pushes a button to deploy to production
  2. AFTER deploying to production: Something (e.g. a pull request) triggers the build, testing, etc, and the code gets successfully released to production - THEN master is updated

But in the case of going with option (1), if the tests aren't passing and the newly updated master won't get released into production, do you then just reset master before you go home for the day?


回答1:


if the tests aren't passing and the newly updated master won't get released into production,

You can update an ephemeral QA/integration branch first, running the test, and update master if those test pass (and trigger the release into production)

"ephemeral" means: you create/reset the QA branch just for integrating the feature branches marked as being for the next release.
You can see an example of ephemeral branches in the git workflow.



来源:https://stackoverflow.com/questions/45155277/with-git-feature-branch-workflow-when-do-you-update-the-master-branch

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