图解 Semantic Version

本文详细解析了Semantic Versioning的基本结构,包括版本的比较方式和预发布版本的优先级规则。介绍了如何根据主要、次要和补丁版本号确定版本的先后顺序,并阐述了具有相同主要、次要和补丁版本的预发布版本如何进行比较。同时提到了版本范围的标记方式,提供了一种表示版本等价的方法,并给出了 Semantic Versioning 2.0.0 的官方参考链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

基本结构

在这里插入图片描述

版本新旧对比方式

  1. Precedence MUST be calculated by separating the version into major, minor, patch and pre-release identifiers in that order (Build metadata does not figure into precedence).
  2. Precedence is determined by the first difference when comparing each of these identifiers from left to right as follows: Major, minor, and patch versions are always compared numerically.
    Example: 1.0.0 < 2.0.0 < 2.1.0 < 2.1.1.
  3. When major, minor, and patch are equal, a pre-release version has lower precedence than a normal version:
    Example: 1.0.0-alpha < 1.0.0.
  4. Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each dot separated identifier from left to right until a difference is found as follow
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值