-
Notifications
You must be signed in to change notification settings - Fork 0
Semantic versioning
Semantic versioning, often abbreviated as SemVer, is a versioning scheme for software that aims to convey meaning about the underlying changes in a release. A semantic version number consists of three parts: βMajor.Minor.Patchβ, often written as βX.Y.Zβ.
Here's a breakdown of each part:
- Major Version (X) β This is the first number in the version string. It is incremented when you make incompatible changes or introduce breaking changes in your software. These changes typically include changes to the API or other significant structural changes.
- Minor Version (Y) β The second number is the minor version. You increase this number when you add new, but backward-compatible features to your software. This means that users of your software can expect their existing code to work with the new version.
- Patch Version (Z) β The third number is the patch version. You increment it when you make backward-compatible bug fixes. These are typically minor changes and improvements that do not introduce new features or change existing ones.
In addition to the version number, Semantic Versioning also allows for pre-release and build metadata:
- Pre-release Version β You can append a hyphen and a series of dot-separated identifiers (e.g., β-beta.1**β) to indicate that a version is a pre-release. Pre-release versions are for testing and may not be stable.
- Build Metadata β You can append a plus sign and additional information (e.g., β+build123**β) to indicate build or other metadata that doesn't affect the version's precedence.
- v0.0.0 β This is the initial version of your software. The major version is 0 because it's in its early development stages. The minor and patch versions are both set to 0.
As you make changes to your software, you would increment the version according to the rules described earlier:
- You make some minor bug fixes without changing functionality β v0.0.1.
- You add a new feature β v0.1.0.
- You make some breaking changes and update the major version: v1.0.0.
Semantic versioning helps users understand the impact of upgrading to a new version of your software.
For a more practical guide on how to implement and follow Semantic Versioning in your projects, you should consult the official Semantic Versioning specification at semver.org. It provides a comprehensive reference and guidelines for versioning your software.