git-mktag
Create a tag object
SYNOPSIS
git mktag [-m <msg> | -F <file> | --cleanup=<mode>] [--] <object>
PARAMETERS
-m <msg>
Use the given tag message. If -m is not given and -F is also not given, git mktag will use the log message from the commit specified by the <object>.
-F <file>
Read the tag message from the given file.
--cleanup=<mode>
This option is used to specify how the tag message should be cleaned up before it is stored. The <mode> can be strip, verbatim, whitespace, or default. See git commit for details.
<object>
The object the tag is referring to
DESCRIPTION
The git-mktag command creates a tag object and outputs its SHA-1 hash. This command is a low-level plumbing command primarily used by Git's internal mechanisms, such as when creating signed tags. The command primarily consumes data from standard input (stdin), which should be formatted according to the Git tag object format. The standard input must include tagger information (name, email, and timestamp), the object being tagged, and a tag message.
While git-mktag allows the creation of tag objects, you typically won't use this command directly. Higher-level commands like git tag are the preferred way to create and manage tags in most workflows. The primary use case of git-mktag is in scripts or when automating tag creation, especially when the tag message or tagger information needs to be dynamically generated.
CAVEATS
Creating tags with git-mktag requires a well-formatted input on standard input. It's generally easier and safer to use git tag, especially for beginners. Direct use of git-mktag bypasses some of the safety checks performed by git tag.
TAG OBJECT FORMAT
The input to git-mktag on stdin should adhere to the following format:
object <object_sha1>
type <object_type>
tag <tag_name>
tagger <tagger_name> <tagger_email> <timestamp> <timezone>
<tag_message>
SEE ALSO
git tag(1), git cat-file(1)