git master 分支和 release 分支有什么用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20755434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the master branch and release branch for?
提问by newBike
My English is not good enough to understand the explanation of git flow
我的英语不够好,看不懂解释 git flow
For my understanding.
对于我的理解。
Master branch
is for ready-product which can be downloaded on the market by users.
Master branch
是现成的产品,用户可以在市场上下载。
But there is an release branches
I have no ideas theses branches is release for whom ?
但是有一个release branches
我不知道这些分支是为谁发布的?
Release for customers ? or for QA?
为客户发布 ? 或质量保证?
回答by minas
Once develop
has acquired enough features for a release (or a predetermined release date is approaching), you fork a release branch off of develop. Creating this branch starts the next release cycle, so no new features can be added after this point.Only bug fixes, documentation generation, and other release-oriented tasks should go in this branch(which includes testing also).Once it's ready to ship, the release gets merged into master and tagged with a version number. In addition, it should be merged backinto develop, which may have progressed since the release was initiated.
一旦develop
获得了足够的发布功能(或预定的发布日期即将到来),您就可以从开发中分出一个发布分支。创建此分支将启动下一个发布周期,因此在此之后无法添加新功能。只有错误修复、文档生成和其他面向发布的任务应该进入这个分支(也包括测试)。一旦准备好发布,该版本就会合并到 master 中并标记一个版本号。此外,它应该合并回开发,自发布开始以来,它可能已经取得了进展。
Using a dedicated branch to prepare releases makes it possible for one team to polish the current release while another team continues working on features for the next release. It also creates well-defined phases of development (e.g., it's easy to say, “this week we're preparing for version 4.0” and to actually see it in the structure of the repository).
使用专门的分支来准备发布使得一个团队可以改进当前版本,而另一个团队继续为下一个版本开发功能。它还创建了明确定义的开发阶段(例如,很容易说,“本周我们正在准备 4.0 版”并在存储库的结构中实际看到它)。
More info herefor branches
此处有更多分行信息
回答by user2867331
As explained in the original post by V.Driessen:
正如V.Driessen在原帖中所解释的:
Masteris a permanent branch which always reflects a production-ready state. So yes, it is for ready-product which can be downloaded on the market by user.
Master是一个永久分支,它始终反映生产就绪状态。所以是的,它是用于用户可以在市场上下载的现成产品。
Releaseis a temporal supporting branch to support preparation of a new production release. This means mainly bug fixing, documentation, etc as pointed out by minas.
Release是一个临时支持分支,用于支持准备新的生产版本。这主要是指 minas 指出的错误修复、文档等。
回答by Alex D
In the diagram which you linked to, yes, master
is used for a "ready product" which is released to users. (Not everybody uses master
this way, though.)
在您链接的图表中,是的,master
用于发布给用户的“现成产品”。(不过,并不是每个人都使用master
这种方式。)
In the diagram, each time the team is preparing a new "ready product" release, they create a new "release" branch. While they are preparing the release, they don't add any new features to the "release" branch -- adding new features could cause new bugs, and they are trying to get the "release" version as stable as possible before it goes public. They do add commits to the "release" branch to fix any problems which are found during final testing, polish up rough spots, etc. So creating the "release" branch marks the "feature freeze" point -- where they decide that only the features they have already developed are going to make it into the next public release.
在图中,每次团队准备新的“就绪产品”发布时,他们都会创建一个新的“发布”分支。当他们准备发布时,他们不会向“发布”分支添加任何新功能——添加新功能可能会导致新的错误,并且他们试图在“发布”版本公开之前尽可能稳定. 他们确实将提交添加到“发布”分支以修复在最终测试期间发现的任何问题,改进粗糙点等。因此创建“发布”分支标志着“功能冻结”点 - 他们决定只有他们已经开发的功能将进入下一个公开版本。
Once they are ready to go public with a new version of the product, they merge the "release" branch into master
and tag the commit which is used to build the publicly downloadable product. (If they are releasing version 1.0, they might tag the commit 1.0
, and so on.)
一旦他们准备好发布新版本的产品,他们就会将“发布”分支合并到master
用于构建可公开下载的产品的提交中并标记该提交。(如果他们发布 1.0 版,他们可能会标记 commit 1.0
,依此类推。)
At the same time, as they work on new features, they create new "feature" branches (branching out of develop
) and commit onto them. When a new feature is working, they merge its branch back into develop
. develop
is always moving forward.
同时,当他们处理新功能时,他们会创建新的“功能”分支(从 分支出来develop
)并提交到它们上。当一个新功能正在工作时,他们将其分支合并回develop
. develop
一直在前进。