Tags, Releases & SemVer

Marking Releases

Tags are permanent labels on a commit - used to mark versions you ship.

$ git tag -a v1.2.0 -m "Release 1.2.0"   # annotated (recommended)
$ git push origin v1.2.0                   # tags aren't pushed by default!
$ git tag                                  # list
$ git checkout v1.2.0                      # inspect that release

Semantic Versioning (SemVer)

Versions are MAJOR.MINOR.PATCH:

BumpWhenExample
MAJORBreaking changes1.4.2 → 2.0.0
MINORNew features, backward-compatible1.4.2 → 1.5.0
PATCHBug fixes only1.4.2 → 1.4.3
Tip: Annotated tags (-a) store author, date and a message and can be signed - always use them for releases. Lightweight tags (just git tag v1) are fine for private bookmarks.
Warning: git push does not push tags. Ship the release marker with git push origin <tag> or git push --tags, or your v1.2.0 exists only on your machine.