<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="git-mktag(1)">
    <title>git-mktag(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-mktag(1)</primary>
</indexterm>
<simplesect id="git-mktag(1)__name">
<title>NAME</title>
<simpara>git-mktag - Creates a tag object with extra validation</simpara>
</simplesect>
<simplesect id="git-mktag(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git mktag</emphasis></literallayout>
</blockquote>
</simplesect>
<simplesect id="git-mktag(1)__description">
<title>DESCRIPTION</title>
<simpara>Reads a tag's contents on standard input and creates a tag object. The
output is the new tag's &lt;object&gt; identifier.</simpara>
<simpara>This command is mostly equivalent to <xref linkend="git-hash-object(1)" />
invoked with <emphasis>-t tag -w --stdin</emphasis>. I.e. both of these will create and
write a tag found in <emphasis>my-tag</emphasis>:</simpara>
<literallayout class="monospaced">git mktag &lt;my-tag
git hash-object -t tag -w --stdin &lt;my-tag</literallayout>
<simpara>The difference is that mktag will die before writing the tag if the
tag doesn't pass a <xref linkend="git-fsck(1)" /> check.</simpara>
<simpara>The "fsck" check done by mktag is stricter than what <xref linkend="git-fsck(1)" />
would run by default in that all <emphasis>fsck.&lt;msg-id&gt;</emphasis> messages are promoted
from warnings to errors (so e.g. a missing "tagger" line is an error).</simpara>
<simpara>Extra headers in the object are also an error under mktag, but ignored
by <xref linkend="git-fsck(1)" />. This extra check can be turned off by setting
the appropriate <emphasis>fsck.&lt;msg-id&gt;</emphasis> variable:</simpara>
<literallayout class="monospaced">git -c fsck.extraHeaderEntry=ignore mktag &lt;my-tag-with-headers</literallayout>
</simplesect>
<simplesect id="git-mktag(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--strict
</term>
<listitem>
<simpara>
        By default mktag turns on the equivalent of
        <xref linkend="git-fsck(1)" /> <emphasis>--strict</emphasis> mode. Use <emphasis>--no-strict</emphasis> to
        disable it.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-mktag(1)__tag_format">
<title>Tag Format</title>
<simpara>A tag signature file, to be fed to this command's standard input,
has a very simple fixed format: four lines of</simpara>
<literallayout class="monospaced">object &lt;hash&gt;
type &lt;typename&gt;
tag &lt;tagname&gt;
tagger &lt;tagger&gt;</literallayout>
<simpara>followed by some <emphasis>optional</emphasis> free-form message (some tags created
by older Git may not have a <emphasis>tagger</emphasis> line).  The message, when it
exists, is separated by a blank line from the header.  The
message part may contain a signature that Git itself doesn't
care about, but that can be verified with gpg.</simpara>
</simplesect>
<simplesect id="git-mktag(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
