Skip to main content
Middle

Git Tags

Middle

Task

Place two permanent markers in the history and finish on an old commit.

Requirements

  • Create the tag v1 on commit C1.
  • Create the tag v0 on the root commit C0.
  • At the end, HEAD must point directly to C0 in a detached state.
  • The tag names must be exactly v0 and v1.

Expected result

The tags will stay attached to C0 and C1, the existing branches will not change, and HEAD will end up on C0.

What you will learn

After completing the task, you will be able to:

  • create tags on specific commits;
  • tell a fixed tag apart from a moving branch;
  • understand a detached HEAD when moving to a point in history.
Goal
localC0HEAD #v0C1main #v1
Git trainer0 commands
terminal
localC0C1HEAD main