源代码控制:分支应该使用什么版本编号?
如果在源代码管理中创建分支,如果分支代码有发布版本,应使用什么版本号?
例如。如果最后一个版本号是 v1.2.8 并且创建了一个分支,那么该分支和主干的下一个版本号应该是什么?
If a branch is created in source control, what version number should be used if there is a release of the branched code?
eg. If the last version number was v1.2.8 and a branch is created, what should the next version numbers of the branch and the main trunk be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我们的项目中,我们遵循单一发布分支策略:发布将始终在发布分支上执行。可能有多个开发/功能/错误修复分支,但我们从不从这些分支发布产品。它们将首先合并到发布分支并从发布分支发布。
在非发布分支上,始终使用 SNAPSHOT 版本(我们使用 Maven),版本名称是分支名称。例如,在名为
featureX
的分支上,版本为featureX-SNAPSHOT
。在发布分支时使用数字版本。版本号将在新版本中逐步增加。这样,我们就不会担心在非发布分支中使用什么版本号。In our project we follow the single release branch strategy: release will be always performed on release branch. There can be several development/feature/bug-fixing branches, but we never release the product from those branches. They will first be merged into release branch and release from release branch.
On non-release branch, SNAPSHOT version is always used (we use Maven) and the version name is the branch name . For example on a branch which names
featureX
, the version isfeatureX-SNAPSHOT
. On release branch numeric version is used. Version number will be stepped in new release. In this way, we won't be bothered what version number to use in a non-release branch.这取决于分支的用途(它隔离的开发工作,如“何时应该你分支”)
例如,对于不添加任何新功能的修复,它可能是
v1.2.9
。但实际上版本号策略是:
需要记住的重要一点是像
vx.yz
可以在任何分支上生成。它只是标志着开发生命周期中的一个稳定点。It depends what the branch is for (what development effort it isolate, as described in "When should you branch")
For instance, for a fix which doesn't add any new feature, it could be
v1.2.9
.But actually the version number policies are :
The important thing to remember is that a label like
vx.y.z
can be generated on any branch. It simply marks a stable point in the development life-cycle.