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 the Subject: 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 back git format-patch -k output. πŸ”₯

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 -k is 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 by i18n.commitEncoding (defaulting to UTF-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 by i18n.commitEncoding or UTF-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 the Message-ID header 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 overriding mailinfo.scissors settings. 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 a CRLF instead of a simple LF. 😭

The valid actions are:

  • nowarn: Git will do nothing when such a CRLF is found.
  • warn: Git will issue a warning for each message if such a CRLF is found.
  • strip: Git will convert those CRLF to LF.
The default action could be set by the configuration option mailinfo.quotedCR. If no such configuration option has been set, warn will be used.
  • <msg> β€” the commit log message extracted from the e-mail, usually except the title line, which comes from the e-mail Subject. πŸŽ€
  • <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 --scissors option 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