Code

Add option to enable threading headers
[git.git] / Documentation / git-format-patch.txt
1 git-format-patch(1)
2 ===================
4 NAME
5 ----
6 git-format-patch - Prepare patches for e-mail submission
9 SYNOPSIS
10 --------
11 [verse]
12 'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--thread]
13                    [-s | --signoff] [--diff-options] [--start-number <n>]
14                    <since>[..<until>]
16 DESCRIPTION
17 -----------
19 Prepare each commit between <since> and <until> with its patch in
20 one file per commit, formatted to resemble UNIX mailbox format.
21 If ..<until> is not specified, the head of the current working
22 tree is implied.
24 The output of this command is convenient for e-mail submission or
25 for use with gitlink:git-am[1].
27 Each output file is numbered sequentially from 1, and uses the
28 first line of the commit message (massaged for pathname safety) as
29 the filename. The names of the output files are printed to standard
30 output, unless the --stdout option is specified.
32 If -o is specified, output files are created in <dir>.  Otherwise
33 they are created in the current working directory.
35 If -n is specified, instead of "[PATCH] Subject", the first line
36 is formatted as "[PATCH n/m] Subject".
38 If given --thread, git-format-patch will generate In-Reply-To and
39 References headers to make the second and subsequent patch mails appear
40 as replies to the first mail; this also generates a Message-Id header to
41 reference.
43 OPTIONS
44 -------
45 -o|--output-directory <dir>::
46         Use <dir> to store the resulting files, instead of the
47         current working directory.
49 -n|--numbered::
50         Name output in '[PATCH n/m]' format.
52 --start-number <n>::
53         Start numbering the patches at <n> instead of 1.
55 -k|--keep-subject::
56         Do not strip/add '[PATCH]' from the first line of the
57         commit log message.
59 -s|--signoff::
60         Add `Signed-off-by:` line to the commit message, using
61         the committer identity of yourself.
63 --stdout::
64         Print all commits to the standard output in mbox format,
65         instead of creating a file for each one.
67 --attach::
68         Create attachments instead of inlining patches.
70 --thread::
71         Add In-Reply-To and References headers to make the second and
72         subsequent mails appear as replies to the first.  Also generates
73         the Message-Id header to reference.
75 CONFIGURATION
76 -------------
77 You can specify extra mail header lines to be added to each
78 message in the repository configuration as follows:
80 [format]
81         headers = "Organization: git-foo\n"
84 EXAMPLES
85 --------
87 git-format-patch -k --stdout R1..R2 | git-am -3 -k::
88         Extract commits between revisions R1 and R2, and apply
89         them on top of the current branch using `git-am` to
90         cherry-pick them.
92 git-format-patch origin::
93         Extract all commits which are in the current branch but
94         not in the origin branch.  For each commit a separate file
95         is created in the current directory.
97 git-format-patch -M -B origin::
98         The same as the previous one.  Additionally, it detects
99         and handles renames and complete rewrites intelligently to
100         produce a renaming patch.  A renaming patch reduces the
101         amount of text output, and generally makes it easier to
102         review it.  Note that the "patch" program does not
103         understand renaming patches, so use it only when you know
104         the recipient uses git to apply your patch.
107 See Also
108 --------
109 gitlink:git-am[1], gitlink:git-send-email[1]
112 Author
113 ------
114 Written by Junio C Hamano <junkio@cox.net>
116 Documentation
117 --------------
118 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
120 GIT
121 ---
122 Part of the gitlink:git[7] suite