GIT-MKTAG(1)
π
GIT-MKTAG(1) β like, the git-mktag manual, bestie β¨
okay so welcome to the git-mktag(1) page, you're gonna eat this up π
πΈ NAME πΈ
git-mktag β creates a tag object, but with extra validation, because we're thorough π
β¨ SYNOPSIS β¨
git mktag
that's it. that's the whole vibe check. no args, no drama π
π¦ DESCRIPTION π¦
so it reads a tag's contents from standard input and creates a tag object. the output? the new tag's <object> identifier. slay β¨
this command is mostly equivalent to git-hash-object(1) invoked with -t tag -w --stdin. like, both of these will create and write a tag found in my-tag:
git mktag <my-tag
git hash-object -t tag -w --stdin <my-tag
the difference?? mktag will die before writing the tag if the tag doesn't pass a git-fsck(1) check. it's giving protective bestie energy honestly π«Ά
and the "fsck" check that mktag does is stricter than what git-fsck(1) would run by default β all fsck.<msg-id> messages get promoted from warnings to errors. so like, a missing "tagger" line?? yeah that's an error now. no cap π
extra headers in the object are also an error under mktag, but git-fsck(1) just ignores them. rude of fsck honestly π but you can turn this extra check off by setting the appropriate fsck.<msg-id> variable:
git -c fsck.extraHeaderEntry=ignore mktag <my-tag-with-headers
there you go, one line, iconic π
π₯ OPTIONS π₯
--strictβ by defaultmktagturns on the equivalent ofgit-fsck(1) --strictmode. use--no-strictto disable it. that's the whole option, bestie, she's simple and she works π
π TAG FORMAT π
a tag signature file (the thing you feed to this command's standard input, iykyk) has a very simple fixed format β four lines of:
object <hash>
type <typename>
tag <tagname>
tagger <tagger>
followed by some optional free-form message π (some tags created by older Git may not have a tagger line, so don't come for them, they're vintage π§)
the message, when it exists, is separated by a blank line from the header. and the message part may contain a signature that Git itself doesn't care about, but that can be verified with gpg. not Git's business, not Git's problem π
lowkey important: those four header lines are fixed, so don't freestyle the order or the field names β that's the whole point of the validation πΈ
π GIT π
part of the git(1) suite, obviously. where else would she live π©·
okay that's the whole page, and before you close the tab: this was Git 2.56.0 and it's dated 2026-09-27, so screenshot the receipts and go make some tags, bestie β fr fr you got this ππ
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms