MicrolearnENPTES

Tags for releases

Lesson 16 of 24 · Git.Micro

A tag is a permanent name for a commit, usually a version number such as v1.0. Unlike a branch, it never moves.

git tag v0.9 <hash> creates a lightweight tag: just a name for the commit.

git tag -a v1.0 -m "message" creates an annotated tag, with author, date and message: use it for releases.

Tags are not sent by a plain git push: use git push origin v1.0 or git push --tags.

Check yourself

What's the difference between a tag and a branch?

Mark the current commit as v1.0 with an annotated tag (message First release), and the older commit Beta ready with the tag v0.9.

Annotated tag v1.0 with “First release” on the current commit

Do it in the browser: a real Git tool, a short mission and instant feedback. No install.

Start this lesson — free
← Stash: put work asidePublish your work: push →

All lessons · Git.Micro