GIT-MAILINFO(1)
π GIT-MAILINFO β the little email-to-commit goblin β¨
okay so bestie, this is git-mailinfo, part of the git(1) suite β it's the β¨backstage crewβ¨ of git, and honestly it's giving stagehand energy: you almost never see it, but the show does not go on without it. π
πΈ SYNOPSIS πΈ
git mailinfo [-k|-b] [-u | --encoding=<encoding> | -n]
[--[no-]scissors] [--quoted-cr=<action>]
<msg> <patch>
π¦ DESCRIPTION π¦
So here's the vibe: it reads a single e-mail message from the standard input, then writes the commit log message into the <msg> file and the patches into the <patch> file. π
The author name, e-mail and e-mail subject get written out to standard output, so that git am can use them to create a commit. Gorgeous. Iconic. Chef's kiss.
Ngl though β it's usually not necessary to use this command directly. Like, you could, but you'd be doing the group project all by yourself for no reason. See git-am(1) instead. π«Ά
lowkey a "let the adults handle it" situation, no cap
π OPTIONS π
-kβ okay so normally the program removes email cruft from theSubject:header line to pull out the title line for the commit log message. This option prevents that munging, and it's most useful when you're reading backgit format-patch -koutput. π₯
Specifically, the following get removed until none of them remain:
- Leading and trailing whitespace.
- Leading
Re:,re:, and:. - Leading bracketed strings (between
[and], usually[PATCH]).
Finally, runs of whitespace are normalized to a single ASCII space character. clean. pristine. main character energy. β¨
-bβ when-kis not in effect, all leading strings bracketed with[and]pairs get stripped. This option limits the stripping to only the pairs whose bracketed string contains the word"PATCH". selective queen behavior π-uβ the commit log message, author name and author email are taken from the e-mail, and after minimally decoding MIME transfer encoding, they're re-coded in the charset specified byi18n.commitEncoding(defaulting toUTF-8) by transliterating them. This used to be optional but now it's the default, so likeβ¦ it's just how things are now. πββοΈ
β οΈ note that the patch is always used as-is without charset conversion, even with this flag. the patch does not get a glow-up. it stays exactly as it is. π
--encoding=<encoding>β similar to-u, but when re-coding, the charset specified here is used instead of the one specified byi18n.commitEncodingorUTF-8. you're overriding the override, we love a custom pick π-nβ disable all charset re-coding of the metadata. no conversions, no transliteration, we're raw-dogging the bytes (respectfully). π-m,--message-idβ copies theMessage-IDheader at the end of the commit message. This is useful for associating commits with mailing list discussions β iykyk, it's the receipts trail. π§--scissorsβ removes everything in the body before a scissors line (e.g."-- >8 --"). That line represents scissors and perforation marks, and it's used to request that the reader cut the message at that line. If that line appears in the body of the message before the patch, everything before it (including the scissors line itself) is ignored when this option is used. βοΈβ¨
This is useful if you wanna begin your message in a discussion thread with comments and suggestions on the message you're responding to, and then conclude it with a patch submission β separating the discussion and the beginning of the proposed commit log message with a scissors line. literally "chit-chat above the cut, commit below the cut." obsessed. π«Ά
this can be enabled by default with the configuration option mailinfo.scissors.
--no-scissorsβ ignores scissors lines. Useful for overridingmailinfo.scissorssettings. sometimes you just don't want the cut, and that's valid π--quoted-cr=<action>β this is the action taken when processing email messages sent with base64 or quoted-printable encoding, and the decoded lines end with aCRLFinstead of a simpleLF. π
The valid actions are:
nowarn: Git will do nothing when such aCRLFis found.warn: Git will issue a warning for each message if such aCRLFis found.strip: Git will convert thoseCRLFtoLF.
The default action could be set by the configuration optionmailinfo.quotedCR. If no such configuration option has been set,warnwill be used.
<msg>β the commit log message extracted from the e-mail, usually except the title line, which comes from the e-mailSubject. π<patch>β the patch extracted from the e-mail. that's it. that's the whole thing. π¦
π CONFIGURATION π
fr fr, everything below this line in this section is selectively included from the git-config(1) documentation β the content is the same as what's found there, no notes, no edits, identical. π
mailinfo.scissorsβ if true, this makes git-mailinfo(1) (and therefore git-am(1)) act by default as if the--scissorsoption was provided on the command-line. When active, this feature removes everything from the message body before a scissors line (i.e. consisting mainly of">8","8<"and"-"). βοΈπ
π GIT π
Part of the git(1) suite. you already knew that, but we said it anyway. π
okay that's the whole page bestie!! π source/version: Git 2.56.0, dated 2026-09-27 β go forth and mail your info, or honestly just use git-am(1). slay. πβ¨π¦πΈπ«Ά
π¦ 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