>_ IzzyLab

Hands-on task

This task is step 4 of the course “Git: rewriting and rescuing history”

Annotated tag on the right commit

medium~7 min

In the repository /root/repo there are three commits with the messages first, second and third (the last one is the current HEAD). Mark exactly the second commit (not the last one!) with an annotated tag v2.0 and the message release two. The tag must be annotated and point at the second commit.

What you'll practise:
  • git tag -a
  • annotated tags
  • commit hash
  • releases

Topic breakdown

Git tags come in two kinds: a lightweight one is just a named pointer to a commit, while an annotated one is a full-fledged object with an author, date, and message, created with the -a flag (the text is supplied via -m). By default git tag marks the current HEAD, so to tag a different commit you pass its hash as the last argument, having found it in git log. Annotated tags are the standard for marking releases.

What's checked

  1. tag v2.0 created
  2. tag is annotated
  3. tag points at second
  4. tag message is release two

What it looks like