]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-send-email.txt
git-stash: fix flag parsing
[thirdparty/git.git] / Documentation / git-send-email.txt
CommitLineData
215a7ad1
JH
1git-send-email(1)
2=================
479cec96
RA
3
4NAME
5----
215a7ad1 6git-send-email - Send a collection of patches as emails
479cec96
RA
7
8
9SYNOPSIS
10--------
5df9fcf6 11'git send-email' [options] <file|directory|rev-list options>...
479cec96
RA
12
13
479cec96
RA
14DESCRIPTION
15-----------
16Takes the patches given on the command line and emails them out.
94af7c31
PB
17Patches can be specified as files, directories (which will send all
18files in the directory), or directly as a revision list. In the
19last case, any format accepted by linkgit:git-format-patch[1] can
20be passed to git send-email.
479cec96
RA
21
22The header of the email is configurable by command line options. If not
23specified on the command line, the user will be prompted with a ReadLine
24enabled interface to provide the necessary information.
25
c4ba87a6
TZ
26There are two formats accepted for patch files:
27
281. mbox format files
29+
30This is what linkgit:git-format-patch[1] generates. Most headers and MIME
31formatting are ignored.
32
332. The original format used by Greg Kroah-Hartman's 'send_lots_of_email.pl'
34script
35+
36This format expects the first line of the file to contain the "Cc:" value
37and the "Subject:" of the message as the second line.
38
917f3e73 39
df8baa42
JF
40OPTIONS
41-------
917f3e73
MW
42
43Composing
44~~~~~~~~~
479cec96 45
432b1282 46--annotate::
3a78d078
MW
47 Review and edit each patch you're about to send. See the
48 CONFIGURATION section for 'sendemail.multiedit'.
432b1282 49
4c0fe0af 50--bcc=<address>::
3971a973
MW
51 Specify a "Bcc:" value for each email. Default is the value of
52 'sendemail.bcc'.
5ef1f8d4
SV
53+
54The --bcc option must be repeated for each user you want on the bcc list.
79ee555b 55
4c0fe0af 56--cc=<address>::
da140f8b 57 Specify a starting "Cc:" value for each email.
bd7c6e7f 58 Default is the value of 'sendemail.cc'.
5ef1f8d4
SV
59+
60The --cc option must be repeated for each user you want on the cc list.
79ee555b 61
2718435b 62--compose::
b4479f07
JN
63 Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1])
64 to edit an introductory message for the patch series.
beece9da 65+
01d38612
SB
66When '--compose' is used, git send-email will use the From, Subject, and
67In-Reply-To headers specified in the message. If the body of the message
68(what you type after the headers and a blank line) only contains blank
69(or GIT: prefixed) lines the summary won't be sent, but From, Subject,
70and In-Reply-To headers will be used unless they are removed.
beece9da 71+
01d38612 72Missing From or In-Reply-To headers will be prompted for.
3a78d078
MW
73+
74See the CONFIGURATION section for 'sendemail.multiedit'.
479cec96 75
4c0fe0af 76--from=<address>::
09caa24f
TP
77 Specify the sender of the emails. If not specified on the command line,
78 the value of the 'sendemail.from' configuration option is used. If
79 neither the command line option nor 'sendemail.from' are set, then the
80 user will be prompted for the value. The default for the prompt will be
81 the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not
82 set, as returned by "git var -l".
479cec96 83
4c0fe0af 84--in-reply-to=<identifier>::
479cec96 85 Specify the contents of the first In-Reply-To header.
928a5590 86 Subsequent emails will refer to the previous email
41fe87fa 87 instead of this if --chain-reply-to is set.
f9e320c3
RA
88 Only necessary if --compose is also set. If --compose
89 is not set, this will be prompted for.
479cec96 90
4c0fe0af 91--subject=<string>::
917f3e73
MW
92 Specify the initial subject of the email thread.
93 Only necessary if --compose is also set. If --compose
94 is not set, this will be prompted for.
a6d62cdd 95
4c0fe0af 96--to=<address>::
917f3e73
MW
97 Specify the primary recipient of the emails generated. Generally, this
98 will be the upstream maintainer of the project involved. Default is the
99 value of the 'sendemail.to' configuration value; if that is unspecified,
100 this will be prompted for.
101+
102The --to option must be repeated for each user you want on the to list.
103
3cae7e5b
TR
104--8bit-encoding=<encoding>::
105 When encountering a non-ASCII message or subject that does not
106 declare its encoding, add headers/quoting to indicate it is
107 encoded in <encoding>. Default is the value of the
108 'sendemail.assume8bitEncoding'; if that is unspecified, this
109 will be prompted for if any non-ASCII files are encountered.
110+
111Note that no attempts whatsoever are made to validate the encoding.
112
917f3e73
MW
113
114Sending
115~~~~~~~
116
4c0fe0af 117--envelope-sender=<address>::
917f3e73
MW
118 Specify the envelope sender used to send the emails.
119 This is useful if your default address is not the address that is
c89e3241
FC
120 subscribed to a list. In order to use the 'From' address, set the
121 value to "auto". If you use the sendmail binary, you must have
122 suitable privileges for the -f parameter. Default is the value of the
123 'sendemail.envelopesender' configuration variable; if that is
917f3e73 124 unspecified, choosing the envelope sender is left to your MTA.
73811e66 125
4c0fe0af 126--smtp-encryption=<encryption>::
73811e66
MW
127 Specify the encryption to use, either 'ssl' or 'tls'. Any other
128 value reverts to plain SMTP. Default is the value of
129 'sendemail.smtpencryption'.
130
79ca070c
BG
131--smtp-domain=<FQDN>::
132 Specifies the Fully Qualified Domain Name (FQDN) used in the
133 HELO/EHLO command to the SMTP server. Some servers require the
134 FQDN to match your IP address. If not set, git send-email attempts
69cf7bfd
BG
135 to determine your FQDN automatically. Default is the value of
136 'sendemail.smtpdomain'.
79ca070c 137
4c0fe0af 138--smtp-pass[=<password>]::
73811e66
MW
139 Password for SMTP-AUTH. The argument is optional: If no
140 argument is specified, then the empty string is used as
3971a973
MW
141 the password. Default is the value of 'sendemail.smtppass',
142 however '--smtp-pass' always overrides this value.
73811e66
MW
143+
144Furthermore, passwords need not be specified in configuration files
145or on the command line. If a username has been specified (with
3971a973
MW
146'--smtp-user' or a 'sendemail.smtpuser'), but no password has been
147specified (with '--smtp-pass' or 'sendemail.smtppass'), then the
73811e66 148user is prompted for a password while the input is masked for privacy.
34cc60ce 149
4c0fe0af 150--smtp-server=<host>::
928a5590
JA
151 If set, specifies the outgoing SMTP server to use (e.g.
152 `smtp.example.com` or a raw IP address). Alternatively it can
153 specify a full pathname of a sendmail-like program instead;
6dcfa306
SV
154 the program must support the `-i` option. Default value can
155 be specified by the 'sendemail.smtpserver' configuration
156 option; the built-in default is `/usr/sbin/sendmail` or
157 `/usr/lib/sendmail` if such program is available, or
158 `localhost` otherwise.
a6d62cdd 159
4c0fe0af 160--smtp-server-port=<port>::
44b2476a 161 Specifies a port different from the default port (SMTP
2da846e7
WL
162 servers typically listen to smtp port 25, but may also listen to
163 submission port 587, or the common SSL smtp port 465);
164 symbolic port names (e.g. "submission" instead of 587)
dd602bf8
MW
165 are also accepted. The port can also be set with the
166 'sendemail.smtpserverport' configuration variable.
44b2476a 167
73811e66 168--smtp-ssl::
3971a973 169 Legacy alias for '--smtp-encryption ssl'.
73811e66 170
4c0fe0af 171--smtp-user=<user>::
3971a973
MW
172 Username for SMTP-AUTH. Default is the value of 'sendemail.smtpuser';
173 if a username is not specified (with '--smtp-user' or 'sendemail.smtpuser'),
174 then authentication is not attempted.
2363d746 175
917f3e73
MW
176
177Automating
178~~~~~~~~~~
179
4c0fe0af 180--cc-cmd=<command>::
917f3e73
MW
181 Specify a command to execute once per patch file which
182 should generate patch file specific "Cc:" entries.
183 Output of this command must be single email address per line.
184 Default is the value of 'sendemail.cccmd' configuration value.
185
0fd41f2d 186--[no-]chain-reply-to::
917f3e73
MW
187 If this is set, each email will be sent as a reply to the previous
188 email sent. If disabled with "--no-chain-reply-to", all emails after
189 the first will be sent as replies to the first email sent. When using
190 this, it is recommended that the first file given be an overview of the
41fe87fa
JH
191 entire patch series. Disabled by default, but the 'sendemail.chainreplyto'
192 configuration variable can be used to enable it.
917f3e73 193
4c0fe0af 194--identity=<identity>::
917f3e73
MW
195 A configuration identity. When given, causes values in the
196 'sendemail.<identity>' subsection to take precedence over
197 values in the 'sendemail' section. The default identity is
198 the value of 'sendemail.identity'.
199
200--[no-]signed-off-by-cc::
201 If this is set, add emails found in Signed-off-by: or Cc: lines to the
ddc3d4fe 202 cc list. Default is the value of 'sendemail.signedoffbycc' configuration
917f3e73 203 value; if that is unspecified, default to --signed-off-by-cc.
2718435b 204
4c0fe0af 205--suppress-cc=<category>::
65648283 206 Specify an additional category of recipients to suppress the
3531e270
JS
207 auto-cc of:
208+
209--
210- 'author' will avoid including the patch author
211- 'self' will avoid including the sender
212- 'cc' will avoid including anyone mentioned in Cc lines in the patch header
213 except for self (use 'self' for that).
cb8a9bd5 214- 'bodycc' will avoid including anyone mentioned in Cc lines in the
3531e270
JS
215 patch body (commit message) except for self (use 'self' for that).
216- 'sob' will avoid including anyone mentioned in Signed-off-by lines except
217 for self (use 'self' for that).
218- 'cccmd' will avoid running the --cc-cmd.
cb8a9bd5 219- 'body' is equivalent to 'sob' + 'bodycc'
3531e270
JS
220- 'all' will suppress all auto cc values.
221--
222+
223Default is the value of 'sendemail.suppresscc' configuration value; if
224that is unspecified, default to 'self' if --suppress-from is
225specified, as well as 'body' if --no-signed-off-cc is specified.
65648283 226
73811e66
MW
227--[no-]suppress-from::
228 If this is set, do not add the From: address to the cc: list.
229 Default is the value of 'sendemail.suppressfrom' configuration
230 value; if that is unspecified, default to --no-suppress-from.
231
7ecbad91 232--[no-]thread::
f693b7e9
YD
233 If this is set, the In-Reply-To and References headers will be
234 added to each email sent. Whether each mail refers to the
235 previous email (`deep` threading per 'git format-patch'
236 wording) or to the first email (`shallow` threading) is
237 governed by "--[no-]chain-reply-to".
238+
239If disabled with "--no-thread", those headers will not be added
240(unless specified with --in-reply-to). Default is the value of the
241'sendemail.thread' configuration value; if that is unspecified,
242default to --thread.
243+
244It is up to the user to ensure that no In-Reply-To header already
245exists when 'git send-email' is asked to add it (especially note that
246'git format-patch' can be configured to do the threading itself).
247Failure to do so may not produce the expected result in the
248recipient's MUA.
e46f7a0e 249
917f3e73
MW
250
251Administering
252~~~~~~~~~~~~~
253
4c0fe0af 254--confirm=<mode>::
c1f2aa45
JS
255 Confirm just before sending:
256+
257--
258- 'always' will always confirm before sending
259- 'never' will never confirm before sending
260- 'cc' will confirm before sending when send-email has automatically
261 added addresses from the patch to the Cc list
262- 'compose' will confirm before sending the first message when using --compose.
263- 'auto' is equivalent to 'cc' + 'compose'
264--
265+
266Default is the value of 'sendemail.confirm' configuration value; if that
267is unspecified, default to 'auto' unless any of the suppress options
268have been specified, in which case default to 'compose'.
269
917f3e73
MW
270--dry-run::
271 Do everything except actually send the emails.
272
432b1282
MW
273--[no-]format-patch::
274 When an argument may be understood either as a reference or as a file name,
275 choose to understand it as a format-patch argument ('--format-patch')
276 or as a file name ('--no-format-patch'). By default, when such a conflict
277 occurs, git send-email will fail.
278
917f3e73
MW
279--quiet::
280 Make git-send-email less verbose. One line per email should be
281 all that is output.
03044a98 282
dbf5e1e9
MW
283--[no-]validate::
284 Perform sanity checks on patches.
7ecbad91
MW
285 Currently, validation means the following:
286+
287--
288 * Warn of patches that contain lines longer than 998 characters; this
289 is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
290--
dbf5e1e9 291+
3971a973
MW
292Default is the value of 'sendemail.validate'; if this is not set,
293default to '--validate'.
7ecbad91 294
a6d62cdd 295
fc095242
AK
296CONFIGURATION
297-------------
917f3e73 298
fc095242
AK
299sendemail.aliasesfile::
300 To avoid typing long email addresses, point this to one or more
301 email aliases files. You must also supply 'sendemail.aliasfiletype'.
302
303sendemail.aliasfiletype::
304 Format of the file(s) specified in sendemail.aliasesfile. Must be
7613ea35 305 one of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.
fc095242 306
8fd5bb7f
PH
307sendemail.multiedit::
308 If true (default), a single editor instance will be spawned to edit
309 files you have to edit (patches when '--annotate' is used, and the
310 summary when '--compose' is used). If false, files will be edited one
311 after the other, spawning a new editor each time.
312
c1f2aa45
JS
313sendemail.confirm::
314 Sets the default for whether to confirm before sending. Must be
315 one of 'always', 'never', 'cc', 'compose', or 'auto'. See '--confirm'
316 in the previous section for the meaning of these values.
317
917f3e73 318
2b873e06
PY
319Use gmail as the smtp server
320----------------------------
321
322Add the following section to the config file:
323
324 [sendemail]
325 smtpencryption = tls
326 smtpserver = smtp.gmail.com
327 smtpuser = yourname@gmail.com
328 smtpserverport = 587
329
330Note: the following perl modules are required
331 Net::SMTP::SSL, MIME::Base64 and Authen::SASL
332
333
479cec96
RA
334Author
335------
336Written by Ryan Anderson <ryan@michonline.com>
337
215a7ad1 338git-send-email is originally based upon
479cec96
RA
339send_lots_of_email.pl by Greg Kroah-Hartman.
340
917f3e73 341
479cec96
RA
342Documentation
343--------------
344Documentation by Ryan Anderson
345
917f3e73 346
479cec96
RA
347GIT
348---
9e1f0a85 349Part of the linkgit:git[1] suite