gitpractice.dev

brewly — Ch.8 · Mark a release

Exercise 1 of 5

Before you start

Tags

A tag is a name for one commit that never moves, unlike a branch. Releases are usually tagged with a version such as v1.4.2: major (breaking changes), minor (new features), patch (fixes).

An annotated tag (-a) records who tagged, when and a message. Use it for releases. A lightweight tag is just a name, handy for private bookmarks.

If you make the wrong kind, delete it with git tag -d <name> and try again.

git tag -a <version> -m "message"
tag the current commit, annotated
git tag <name>
a lightweight tag
git tag
list the tags
git show <tag>
show a tag and its commit
git tag -d <name>
delete a tag
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path