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 default mktag turns on the equivalent of git-fsck(1) --strict mode. use --no-strict to 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