简体中文 ▾ Topics ▾ Latest version ▾ git-mailinfo last updated in 2.43.2


git-mailinfo - 从单个电子邮件信息中提取补丁和作者


git mailinfo [-k|-b] [-u | --encoding=<编码> | -n]
	       [--[no-]scissors] [--quoted-cr=<行为>]
	       <消息> <补丁>


Reads a single e-mail message from the standard input, and writes the commit log message in <msg> file, and the patches in <patch> file. The author name, e-mail and e-mail subject are written out to the standard output to be used by git am to create a commit. It is usually not necessary to use this command directly. See git-am[1] instead.



Usually the program removes email cruft from the Subject: header line to extract the title line for the commit log message. This option prevents this munging, and is most useful when used to read back git format-patch -k output.


  • 前导和尾部的多余空白字符。

  • 前导的的 Re:re:,和 :

  • 前导括号内的字符串(在 [] 之间,通常是 [PATCH])。



When -k is not in effect, all leading strings bracketed with [ and ] pairs are stripped. This option limits the stripping to only the pairs whose bracketed string contains the word "PATCH".


The commit log message, author name and author email are taken from the e-mail, and after minimally decoding MIME transfer encoding, re-coded in the charset specified by i18n.commitEncoding (defaulting to UTF-8) by transliterating them. This used to be optional but now it is the default.



Similar to -u. But when re-coding, the charset specified here is used instead of the one specified by i18n.commitEncoding or UTF-8.




Copy the Message-ID header at the end of the commit message. This is useful in order to associate commits with mailing list discussions.


Remove everything in body before a scissors line (e.g. "-- >8 --"). The line represents scissors and perforation marks, and is used to request the reader to 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.


这可以通过配置选项 mailinfo.scissors 来默认启用。


忽略剪切线。对于覆盖 mailinfo.scissors 设置很有用。


当处理以 base64 或 quoted-printable 编码发送的电子邮件,并且解码后的行以 CRLF 而不是简单的 LF 结尾时,就会启用。


  • nowarn: 当发现这样的 CRLF 时,Git将不做任何事情。

  • warn: 如果有这样的 CRLF,Git 会对每条信息发出警告 找到了。

  • strip: Git 将把这些 CRLF 转换为 LF。

The default action could be set by configuration option mailinfo.quotedCR. If no such configuration option has been set, warn will be used.







Missing zh_HANS-CN/includes/cmd-config-section-all.txt

See original version for this content.


Missing zh_HANS-CN/config/mailinfo.txt

See original version for this content.


属于 git[1] 文档