Forrest logo
back to the git tool

git-tag:tldr:12026

git-tag: Create an annotated tag with the given message.
$ git tag ${tag_name} -m ${tag_message}
try on your machine

The command "git tag ${tag_name} -m ${tag_message}" creates a new tag in a Git repository with a specified tag name and message. Here's a breakdown of the different parts of the command:

  • "git tag": This is the main command to create a new tag in Git.

  • "${tag_name}": This is a placeholder for the actual name of the tag you want to create. You should replace "${tag_name}" with the desired name for your new tag, for example, "v1.0.0" or "release-1.2".

  • "-m": This flag is short for "message" and is followed by "${tag_message}". It allows you to specify a custom message for the tag.

  • "${tag_message}": This is another placeholder for the actual message you want to associate with the tag. You should replace "${tag_message}" with the desired message for your tag, describing its purpose, changes, or any other relevant information.

To use this command, replace "${tag_name}" with your desired tag name and "${tag_message}" with your desired tag message, then execute it in your Git repository. The new tag will be created and associated with the specific commit at your current branch's HEAD.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool