Semantic versioning

What it is

Semantic versioning (SemVer) is a convention for version numbers of the form MAJOR.MINOR.PATCH (e.g. 2.3.1). Each segment communicates how backward-compatible a change is, so consumers can safely decide when to upgrade.

Why it exists

Without a versioning contract, it’s impossible to tell whether a new release breaks you. SemVer makes compatibility machine-readable — tools and developers can rely on the number to know whether an update is safe (patch), adds features (minor), or may break the API (major).

Key ideas

  • MAJOR — incompatible, breaking API change. Bump when consumers must change code.
  • MINOR — backward-compatible new functionality. Bump when you add features.
  • PATCH — backward-compatible bug fixes. Bump when you only fix issues.
  • Pre-release & metadata1.0.0-beta.1, 2.3.1+build.5 for unreleased builds and build metadata.
  • Common practice — tags map to versions (v1.2.3), packages use SemVer in Azure Artifacts/NuGet/npm, and dependency ranges express “compatible with” via ^/~.

Exam notes

  • Memorize: breaking = MAJOR, new feature = MINOR, fix = PATCH.
  • SemVer lets dependency management declare compatible ranges and tells CD pipelines when to cut a release.
  • Version tags (e.g. v2.3.1) are used to mark releases in Git history.

git · branching-strategy · azure-artifacts

📘 Source: Microsoft Learn — Semantic Versioning