DEVOPS / A CONCEPT NOTE

Semantic Versioning

what 2.1.3 promises

~65 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

A standard formatting rule for code releases: MAJOR.MINOR.PATCH. Increment MAJOR for breaking changes, MINOR for features, and PATCH for backward-compatible bug fixes.

02 / FOLLOW THE MECHANISM

How version resolution flows

  1. Bug Fix

    developer patches a security bug, incrementing PATCH: v1.0.1.

  2. New Feature

    adds a new endpoint (backward compatible), incrementing MINOR: v1.1.0.

  3. Breaking Change

    wipes out legacy API support, incrementing MAJOR: v2.0.0.

  4. Client resolve

    clients download updates safely using version ranges (~ or ^) matching their requirements.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

check if a version fits within range constraints

npm semver v2.1.3

EXAMPLE 02 · REFERENCE

publish a SemVer tag to git repository history

git tag -a v2.0.0 -m "breaking release"

Explore command anatomy in the CLI lab