← 返回命令列表

Linux command

git-mailinfo 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Extract patch info

git mailinfo [msg.txt] [patch.txt] < [email.txt]

Keep subject prefix

git mailinfo -k [msg.txt] [patch.txt] < [email.txt]

说明

git mailinfo extracts patch and commit information from email messages. It parses email headers and body, separating the commit message from the patch content, and handles encoding and author extraction. The command is a plumbing tool used internally by `git am`. It processes the email format used in patch-based development workflows, such as those used by the Linux kernel project.

参数

-k
Keep subject line intact.
-b
Strip bracketed strings from subject.
-u
Encode as UTF-8.
--scissors
Remove text before scissors line.
--help
Display help information.

FAQ

What is the git-mailinfo command used for?

git mailinfo extracts patch and commit information from email messages. It parses email headers and body, separating the commit message from the patch content, and handles encoding and author extraction. The command is a plumbing tool used internally by `git am`. It processes the email format used in patch-based development workflows, such as those used by the Linux kernel project.

How do I run a basic git-mailinfo example?

Run `git mailinfo [msg.txt] [patch.txt] < [email.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -k do in git-mailinfo?

Keep subject line intact.