подготовьте исправления для отправки по электронной почте (Prepare patches for e-mail submission)
Описание (Description)
Prepare each non-merge commit with its "patch" in one "message"
per commit, formatted to resemble a UNIX mailbox. The output of
this command is convenient for e-mail submission or for use with
git am.
A "message" generated by the command consists of three parts:
• A brief metadata header that begins with From <commit>
with a
fixed Mon Sep 17 00:00:00 2001
datestamp to help programs
like "file(1)" to recognize that the file is an output from
this command, fields that record the author identity, the
author date, and the title of the change (taken from the
first paragraph of the commit log message).
• The second and subsequent paragraphs of the commit log
message.
• The "patch", which is the "diff -p --stat" output (see
git-diff(1)) between the commit and its parent.
The log message and the patch is separated by a line with a
three-dash line.
There are two ways to specify which commits to operate on.
1. A single commit, <since>, specifies that the commits leading
to the tip of the current branch that are not in the history
that leads to the <since> to be output.
2. Generic <revision range> expression (see "SPECIFYING
REVISIONS" section in gitrevisions(7)) means the commits in
the specified range.
The first rule takes precedence in the case of a single <commit>.
To apply the second rule, i.e., format everything since the
beginning of history up until <commit>, use the --root
option:
git format-patch --root <commit>
. If you want to format only
<commit> itself, you can do this with git format-patch -1
<commit>
.
By default, each output file is numbered sequentially from 1, and
uses the first line of the commit message (massaged for pathname
safety) as the filename. With the --numbered-files
option, the
output file names will only be numbers, without the first line of
the commit appended. The names of the output files are printed to
standard output, unless the --stdout
option is specified.
If -o
is specified, output files are created in <dir>. Otherwise
they are created in the current working directory. The default
path can be set with the format.outputDirectory
configuration
option. The -o
option takes precedence over
format.outputDirectory
. To store patches in the current working
directory even when format.outputDirectory
points elsewhere, use
-o .
. All directory components will be created.
By default, the subject of a single patch is "[PATCH] " followed
by the concatenation of lines from the commit message up to the
first blank line (see the DISCUSSION section of git-commit(1)).
When multiple patches are output, the subject prefix will instead
be "[PATCH n/m] ". To force 1/1 to be added for a single patch,
use -n
. To omit patch numbers from the subject, use -N
.
If given --thread
, git-format-patch
will generate In-Reply-To
and
References
headers to make the second and subsequent patch mails
appear as replies to the first mail; this also generates a
Message-Id
header to reference.