blob: 7cc7fafc1d7fbe380ffa53e0d028886e15d0010e [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-format-patch(1)
2===================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-format-patch - Prepare patches for e-mail submission
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano235a91e2006-01-07 01:13:5811[verse]
Junio C Hamano2496ae42006-03-11 08:04:3312'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [-s] [-c]
Junio C Hamano235a91e2006-01-07 01:13:5813 [--diff-options] <his> [<mine>]
Junio C Hamano1a4e8412005-12-27 08:17:2314
15DESCRIPTION
16-----------
17Prepare each commit with its patch since <mine> head forked from
Junio C Hamano38de0a22006-02-07 10:24:3518<his> head, one file per patch formatted to resemble UNIX mailbox
19format, for e-mail submission or use with gitlink:git-am[1].
Junio C Hamano1a4e8412005-12-27 08:17:2320
Junio C Hamano38de0a22006-02-07 10:24:3521Each output file is numbered sequentially from 1, and uses the
22first line of the commit message (massaged for pathname safety)
23as the filename.
24
25When -o is specified, output files are created in <dir>; otherwise
26they are created in the current working directory. This option
27is ignored if --stdout is specified.
Junio C Hamano1a4e8412005-12-27 08:17:2328
29When -n is specified, instead of "[PATCH] Subject", the first
30line is formatted as "[PATCH N/M] Subject", unless you have only
31one patch.
32
Junio C Hamano1a4e8412005-12-27 08:17:2333
34OPTIONS
35-------
36-o|--output-directory <dir>::
37Use <dir> to store the resulting files, instead of the
38current working directory.
39
40-n|--numbered::
41Name output in '[PATCH n/m]' format.
42
43-k|--keep-subject::
44Do not strip/add '[PATCH]' from the first line of the
45commit log message.
46
Junio C Hamano1a4e8412005-12-27 08:17:2347-s|--signoff::
48Add `Signed-off-by:` line to the commit message, using
49the committer identity of yourself.
50
51-c|--check::
52 Display suspicious lines in the patch. The definition
53 of 'suspicious lines' is currently the lines that has
54 trailing whitespaces, and the lines whose indentation
55 has a SP character immediately followed by a TAB
56 character.
57
Junio C Hamano1a4e8412005-12-27 08:17:2358--stdout::
59This flag generates the mbox formatted output to the
60standard output, instead of saving them into a file per
61patch and implies --mbox.
62
Junio C Hamano2496ae42006-03-11 08:04:3363--attach::
64Create attachments instead of inlining patches.
65
66
67CONFIGURATION
68-------------
69You can specify extra mail header lines to be added to each
70message in the repository configuration as follows:
71
72[format]
73 headers = "Organization: git-foo\n"
74
Junio C Hamano1a4e8412005-12-27 08:17:2375
76EXAMPLES
77--------
78
79git-format-patch -k --stdout R1..R2 | git-am -3 -k::
80Extract commits between revisions R1 and R2, and apply
81them on top of the current branch using `git-am` to
82cherry-pick them.
83
84git-format-patch origin::
85Extract commits the current branch accumulated since it
86pulled from origin the last time in a patch form for
87e-mail submission.
88
89git-format-patch -M -B origin::
90The same as the previous one, except detect and handle
91renames and complete rewrites intelligently to produce
92renaming patch. A renaming patch reduces the amount of
93text output, and generally makes it easier to review
94it. Note that the "patch" program does not understand
95renaming patch well, so use it only when you know the
96recipient uses git to apply your patch.
97
98
99See Also
100--------
Junio C Hamano235a91e2006-01-07 01:13:58101gitlink:git-am[1], gitlink:git-send-email[1]
Junio C Hamano1a4e8412005-12-27 08:17:23102
103
104Author
105------
106Written by Junio C Hamano <junkio@cox.net>
107
108Documentation
109--------------
110Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
111
112GIT
113---
114Part of the gitlink:git[7] suite
115