ci updates
[git.git] / Documentation / git-send-email.txt
blob2e6f1d63ae4aad3fb139df515836820eb63a828a
1 git-send-email(1)
2 =================
4 NAME
5 ----
6 git-send-email - Send a collection of patches as emails
9 SYNOPSIS
10 --------
11 [verse]
12 'git send-email' [<options>] (<file>|<directory>)...
13 'git send-email' [<options>] <format-patch-options>
14 'git send-email' --dump-aliases
15 'git send-email' --translate-aliases
18 DESCRIPTION
19 -----------
20 Takes the patches given on the command line and emails them out.
21 Patches can be specified as files, directories (which will send all
22 files in the directory), or directly as a revision list.  In the
23 last case, any format accepted by linkgit:git-format-patch[1] can
24 be passed to git send-email, as well as options understood by
25 linkgit:git-format-patch[1].
27 The header of the email is configurable via command-line options.  If not
28 specified on the command line, the user will be prompted with a ReadLine
29 enabled interface to provide the necessary information.
31 There are two formats accepted for patch files:
33 1. mbox format files
35 This is what linkgit:git-format-patch[1] generates.  Most headers and MIME
36 formatting are ignored.
38 2. The original format used by Greg Kroah-Hartman's 'send_lots_of_email.pl'
39    script
41 This format expects the first line of the file to contain the "Cc:" value
42 and the "Subject:" of the message as the second line.
45 OPTIONS
46 -------
48 Composing
49 ~~~~~~~~~
51 --annotate::
52         Review and edit each patch you're about to send. Default is the value
53         of `sendemail.annotate`. See the CONFIGURATION section for
54         `sendemail.multiEdit`.
56 --bcc=<address>,...::
57         Specify a "Bcc:" value for each email. Default is the value of
58         `sendemail.bcc`.
60 This option may be specified multiple times.
62 --cc=<address>,...::
63         Specify a starting "Cc:" value for each email.
64         Default is the value of `sendemail.cc`.
66 This option may be specified multiple times.
68 --compose::
69         Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1])
70         to edit an introductory message for the patch series.
72 When `--compose` is used, git send-email will use the From, To, Cc, Bcc,
73 Subject, Reply-To, and In-Reply-To headers specified in the message. If
74 the body of the message (what you type after the headers and a blank
75 line) only contains blank (or Git: prefixed) lines, the summary won't be
76 sent, but the headers mentioned above will be used unless they are
77 removed.
79 Missing From or In-Reply-To headers will be prompted for.
81 See the CONFIGURATION section for `sendemail.multiEdit`.
83 --from=<address>::
84         Specify the sender of the emails.  If not specified on the command line,
85         the value of the `sendemail.from` configuration option is used.  If
86         neither the command-line option nor `sendemail.from` are set, then the
87         user will be prompted for the value.  The default for the prompt will be
88         the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not
89         set, as returned by "git var -l".
91 --reply-to=<address>::
92         Specify the address where replies from recipients should go to.
93         Use this if replies to messages should go to another address than what
94         is specified with the --from parameter.
96 --in-reply-to=<identifier>::
97         Make the first mail (or all the mails with `--no-thread`) appear as a
98         reply to the given Message-ID, which avoids breaking threads to
99         provide a new patch series.
100         The second and subsequent emails will be sent as replies according to
101         the `--[no-]chain-reply-to` setting.
103 So for example when `--thread` and `--no-chain-reply-to` are specified, the
104 second and subsequent patches will be replies to the first one like in the
105 illustration below where `[PATCH v2 0/3]` is in reply to `[PATCH 0/2]`:
107   [PATCH 0/2] Here is what I did...
108     [PATCH 1/2] Clean up and tests
109     [PATCH 2/2] Implementation
110     [PATCH v2 0/3] Here is a reroll
111       [PATCH v2 1/3] Clean up
112       [PATCH v2 2/3] New tests
113       [PATCH v2 3/3] Implementation
115 Only necessary if --compose is also set.  If --compose
116 is not set, this will be prompted for.
118 --subject=<string>::
119         Specify the initial subject of the email thread.
120         Only necessary if --compose is also set.  If --compose
121         is not set, this will be prompted for.
123 --to=<address>,...::
124         Specify the primary recipient of the emails generated. Generally, this
125         will be the upstream maintainer of the project involved. Default is the
126         value of the `sendemail.to` configuration value; if that is unspecified,
127         and --to-cmd is not specified, this will be prompted for.
129 This option may be specified multiple times.
131 --8bit-encoding=<encoding>::
132         When encountering a non-ASCII message or subject that does not
133         declare its encoding, add headers/quoting to indicate it is
134         encoded in <encoding>.  Default is the value of the
135         'sendemail.assume8bitEncoding'; if that is unspecified, this
136         will be prompted for if any non-ASCII files are encountered.
138 Note that no attempts whatsoever are made to validate the encoding.
140 --compose-encoding=<encoding>::
141         Specify encoding of compose message. Default is the value of the
142         'sendemail.composeEncoding'; if that is unspecified, UTF-8 is assumed.
144 --transfer-encoding=(7bit|8bit|quoted-printable|base64|auto)::
145         Specify the transfer encoding to be used to send the message over SMTP.
146         7bit will fail upon encountering a non-ASCII message.  quoted-printable
147         can be useful when the repository contains files that contain carriage
148         returns, but makes the raw patch email file (as saved from a MUA) much
149         harder to inspect manually.  base64 is even more fool proof, but also
150         even more opaque.  auto will use 8bit when possible, and quoted-printable
151         otherwise.
153 Default is the value of the `sendemail.transferEncoding` configuration
154 value; if that is unspecified, default to `auto`.
156 --xmailer::
157 --no-xmailer::
158         Add (or prevent adding) the "X-Mailer:" header.  By default,
159         the header is added, but it can be turned off by setting the
160         `sendemail.xmailer` configuration variable to `false`.
162 Sending
163 ~~~~~~~
165 --envelope-sender=<address>::
166         Specify the envelope sender used to send the emails.
167         This is useful if your default address is not the address that is
168         subscribed to a list. In order to use the 'From' address, set the
169         value to "auto". If you use the sendmail binary, you must have
170         suitable privileges for the -f parameter.  Default is the value of the
171         `sendemail.envelopeSender` configuration variable; if that is
172         unspecified, choosing the envelope sender is left to your MTA.
174 --sendmail-cmd=<command>::
175         Specify a command to run to send the email. The command should
176         be sendmail-like; specifically, it must support the `-i` option.
177         The command will be executed in the shell if necessary.  Default
178         is the value of `sendemail.sendmailCmd`.  If unspecified, and if
179         --smtp-server is also unspecified, git-send-email will search
180         for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH.
182 --smtp-encryption=<encryption>::
183         Specify in what way encrypting begins for the SMTP connection.
184         Valid values are 'ssl' and 'tls'. Any other value reverts to plain
185         (unencrypted) SMTP, which defaults to port 25.
186         Despite the names, both values will use the same newer version of TLS,
187         but for historic reasons have these names. 'ssl' refers to "implicit"
188         encryption (sometimes called SMTPS), that uses port 465 by default.
189         'tls' refers to "explicit" encryption (often known as STARTTLS),
190         that uses port 25 by default. Other ports might be used by the SMTP
191         server, which are not the default. Commonly found alternative port for
192         'tls' and unencrypted is 587. You need to check your provider's
193         documentation or your server configuration to make sure
194         for your own case. Default is the value of `sendemail.smtpEncryption`.
196 --smtp-domain=<FQDN>::
197         Specifies the Fully Qualified Domain Name (FQDN) used in the
198         HELO/EHLO command to the SMTP server.  Some servers require the
199         FQDN to match your IP address.  If not set, git send-email attempts
200         to determine your FQDN automatically.  Default is the value of
201         `sendemail.smtpDomain`.
203 --smtp-auth=<mechanisms>::
204         Whitespace-separated list of allowed SMTP-AUTH mechanisms. This setting
205         forces using only the listed mechanisms. Example:
207 ------
208 $ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...
209 ------
211 If at least one of the specified mechanisms matches the ones advertised by the
212 SMTP server and if it is supported by the utilized SASL library, the mechanism
213 is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`
214 is specified, all mechanisms supported by the SASL library can be used. The
215 special value 'none' maybe specified to completely disable authentication
216 independently of `--smtp-user`
218 --smtp-pass[=<password>]::
219         Password for SMTP-AUTH. The argument is optional: If no
220         argument is specified, then the empty string is used as
221         the password. Default is the value of `sendemail.smtpPass`,
222         however `--smtp-pass` always overrides this value.
224 Furthermore, passwords need not be specified in configuration files
225 or on the command line. If a username has been specified (with
226 `--smtp-user` or a `sendemail.smtpUser`), but no password has been
227 specified (with `--smtp-pass` or `sendemail.smtpPass`), then
228 a password is obtained using 'git-credential'.
230 --no-smtp-auth::
231         Disable SMTP authentication. Short hand for `--smtp-auth=none`
233 --smtp-server=<host>::
234         If set, specifies the outgoing SMTP server to use (e.g.
235         `smtp.example.com` or a raw IP address).  If unspecified, and if
236         `--sendmail-cmd` is also unspecified, the default is to search
237         for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH if such a
238         program is available, falling back to `localhost` otherwise.
240 For backward compatibility, this option can also specify a full pathname
241 of a sendmail-like program instead; the program must support the `-i`
242 option.  This method does not support passing arguments or using plain
243 command names.  For those use cases, consider using `--sendmail-cmd`
244 instead.
246 --smtp-server-port=<port>::
247         Specifies a port different from the default port (SMTP
248         servers typically listen to smtp port 25, but may also listen to
249         submission port 587, or the common SSL smtp port 465);
250         symbolic port names (e.g. "submission" instead of 587)
251         are also accepted. The port can also be set with the
252         `sendemail.smtpServerPort` configuration variable.
254 --smtp-server-option=<option>::
255         If set, specifies the outgoing SMTP server option to use.
256         Default value can be specified by the `sendemail.smtpServerOption`
257         configuration option.
259 The --smtp-server-option option must be repeated for each option you want
260 to pass to the server. Likewise, different lines in the configuration files
261 must be used for each option.
263 --smtp-ssl::
264         Legacy alias for '--smtp-encryption ssl'.
266 --smtp-ssl-cert-path::
267         Path to a store of trusted CA certificates for SMTP SSL/TLS
268         certificate validation (either a directory that has been processed
269         by 'c_rehash', or a single file containing one or more PEM format
270         certificates concatenated together: see verify(1) -CAfile and
271         -CApath for more information on these). Set it to an empty string
272         to disable certificate verification. Defaults to the value of the
273         `sendemail.smtpSSLCertPath` configuration variable, if set, or the
274         backing SSL library's compiled-in default otherwise (which should
275         be the best choice on most platforms).
277 --smtp-user=<user>::
278         Username for SMTP-AUTH. Default is the value of `sendemail.smtpUser`;
279         if a username is not specified (with `--smtp-user` or `sendemail.smtpUser`),
280         then authentication is not attempted.
282 --smtp-debug=(0|1)::
283         Enable (1) or disable (0) debug output. If enabled, SMTP
284         commands and replies will be printed. Useful to debug TLS
285         connection and authentication problems.
287 --batch-size=<num>::
288         Some email servers (e.g. smtp.163.com) limit the number emails to be
289         sent per session (connection) and this will lead to a failure when
290         sending many messages.  With this option, send-email will disconnect after
291         sending $<num> messages and wait for a few seconds (see --relogin-delay)
292         and reconnect, to work around such a limit.  You may want to
293         use some form of credential helper to avoid having to retype
294         your password every time this happens.  Defaults to the
295         `sendemail.smtpBatchSize` configuration variable.
297 --relogin-delay=<int>::
298         Waiting $<int> seconds before reconnecting to SMTP server. Used together
299         with --batch-size option.  Defaults to the `sendemail.smtpReloginDelay`
300         configuration variable.
302 Automating
303 ~~~~~~~~~~
305 --no-to::
306 --no-cc::
307 --no-bcc::
308         Clears any list of "To:", "Cc:", "Bcc:" addresses previously
309         set via config.
311 --no-identity::
312         Clears the previously read value of `sendemail.identity` set
313         via config, if any.
315 --to-cmd=<command>::
316         Specify a command to execute once per patch file which
317         should generate patch file specific "To:" entries.
318         Output of this command must be single email address per line.
319         Default is the value of 'sendemail.toCmd' configuration value.
321 --cc-cmd=<command>::
322         Specify a command to execute once per patch file which
323         should generate patch file specific "Cc:" entries.
324         Output of this command must be single email address per line.
325         Default is the value of `sendemail.ccCmd` configuration value.
327 --header-cmd=<command>::
328         Specify a command that is executed once per outgoing message
329         and output RFC 2822 style header lines to be inserted into
330         them. When the `sendemail.headerCmd` configuration variable is
331         set, its value is always used. When --header-cmd is provided
332         at the command line, its value takes precedence over the
333         `sendemail.headerCmd` configuration variable.
335 --no-header-cmd::
336         Disable any header command in use.
338 --[no-]chain-reply-to::
339         If this is set, each email will be sent as a reply to the previous
340         email sent.  If disabled with "--no-chain-reply-to", all emails after
341         the first will be sent as replies to the first email sent.  When using
342         this, it is recommended that the first file given be an overview of the
343         entire patch series. Disabled by default, but the `sendemail.chainReplyTo`
344         configuration variable can be used to enable it.
346 --identity=<identity>::
347         A configuration identity. When given, causes values in the
348         'sendemail.<identity>' subsection to take precedence over
349         values in the 'sendemail' section. The default identity is
350         the value of `sendemail.identity`.
352 --[no-]signed-off-by-cc::
353         If this is set, add emails found in the `Signed-off-by` trailer or Cc: lines to the
354         cc list. Default is the value of `sendemail.signedOffByCc` configuration
355         value; if that is unspecified, default to --signed-off-by-cc.
357 --[no-]cc-cover::
358         If this is set, emails found in Cc: headers in the first patch of
359         the series (typically the cover letter) are added to the cc list
360         for each email set. Default is the value of 'sendemail.ccCover'
361         configuration value; if that is unspecified, default to --no-cc-cover.
363 --[no-]to-cover::
364         If this is set, emails found in To: headers in the first patch of
365         the series (typically the cover letter) are added to the to list
366         for each email set. Default is the value of 'sendemail.toCover'
367         configuration value; if that is unspecified, default to --no-to-cover.
369 --suppress-cc=<category>::
370         Specify an additional category of recipients to suppress the
371         auto-cc of:
374 - 'author' will avoid including the patch author.
375 - 'self' will avoid including the sender.
376 - 'cc' will avoid including anyone mentioned in Cc lines in the patch header
377   except for self (use 'self' for that).
378 - 'bodycc' will avoid including anyone mentioned in Cc lines in the
379   patch body (commit message) except for self (use 'self' for that).
380 - 'sob' will avoid including anyone mentioned in the Signed-off-by trailers except
381   for self (use 'self' for that).
382 - 'misc-by' will avoid including anyone mentioned in Acked-by,
383   Reviewed-by, Tested-by and other "-by" lines in the patch body,
384   except Signed-off-by (use 'sob' for that).
385 - 'cccmd' will avoid running the --cc-cmd.
386 - 'body' is equivalent to 'sob' + 'bodycc' + 'misc-by'.
387 - 'all' will suppress all auto cc values.
390 Default is the value of `sendemail.suppressCc` configuration value; if
391 that is unspecified, default to 'self' if --suppress-from is
392 specified, as well as 'body' if --no-signed-off-cc is specified.
394 --[no-]suppress-from::
395         If this is set, do not add the From: address to the cc: list.
396         Default is the value of `sendemail.suppressFrom` configuration
397         value; if that is unspecified, default to --no-suppress-from.
399 --[no-]thread::
400         If this is set, the In-Reply-To and References headers will be
401         added to each email sent.  Whether each mail refers to the
402         previous email (`deep` threading per 'git format-patch'
403         wording) or to the first email (`shallow` threading) is
404         governed by "--[no-]chain-reply-to".
406 If disabled with "--no-thread", those headers will not be added
407 (unless specified with --in-reply-to).  Default is the value of the
408 `sendemail.thread` configuration value; if that is unspecified,
409 default to --thread.
411 It is up to the user to ensure that no In-Reply-To header already
412 exists when 'git send-email' is asked to add it (especially note that
413 'git format-patch' can be configured to do the threading itself).
414 Failure to do so may not produce the expected result in the
415 recipient's MUA.
418 Administering
419 ~~~~~~~~~~~~~
421 --confirm=<mode>::
422         Confirm just before sending:
425 - 'always' will always confirm before sending
426 - 'never' will never confirm before sending
427 - 'cc' will confirm before sending when send-email has automatically
428   added addresses from the patch to the Cc list
429 - 'compose' will confirm before sending the first message when using --compose.
430 - 'auto' is equivalent to 'cc' + 'compose'
433 Default is the value of `sendemail.confirm` configuration value; if that
434 is unspecified, default to 'auto' unless any of the suppress options
435 have been specified, in which case default to 'compose'.
437 --dry-run::
438         Do everything except actually send the emails.
440 --[no-]format-patch::
441         When an argument may be understood either as a reference or as a file name,
442         choose to understand it as a format-patch argument (`--format-patch`)
443         or as a file name (`--no-format-patch`). By default, when such a conflict
444         occurs, git send-email will fail.
446 --quiet::
447         Make git-send-email less verbose.  One line per email should be
448         all that is output.
450 --[no-]validate::
451         Perform sanity checks on patches.
452         Currently, validation means the following:
455                 *       Invoke the sendemail-validate hook if present (see linkgit:githooks[5]).
456                 *       Warn of patches that contain lines longer than
457                         998 characters unless a suitable transfer encoding
458                         ('auto', 'base64', or 'quoted-printable') is used;
459                         this is due to SMTP limits as described by
460                         https://www.ietf.org/rfc/rfc5322.txt.
463 Default is the value of `sendemail.validate`; if this is not set,
464 default to `--validate`.
466 --force::
467         Send emails even if safety checks would prevent it.
470 Information
471 ~~~~~~~~~~~
473 --dump-aliases::
474         Instead of the normal operation, dump the shorthand alias names from
475         the configured alias file(s), one per line in alphabetical order. Note
476         that this only includes the alias name and not its expanded email addresses.
477         See 'sendemail.aliasesFile' for more information about aliases.
479 --translate-aliases::
480         Instead of the normal operation, read from standard input and
481         interpret each line as an email alias. Translate it according to the
482         configured alias file(s). Output each translated name and email
483         address to standard output, one per line. See 'sendemail.aliasFile'
484         for more information about aliases.
486 CONFIGURATION
487 -------------
489 include::includes/cmd-config-section-all.txt[]
491 include::config/sendemail.txt[]
493 EXAMPLES
494 --------
495 Use gmail as the smtp server
496 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
497 To use 'git send-email' to send your patches through the GMail SMTP server,
498 edit ~/.gitconfig to specify your account settings:
500 ----
501 [sendemail]
502         smtpEncryption = tls
503         smtpServer = smtp.gmail.com
504         smtpUser = yourname@gmail.com
505         smtpServerPort = 587
506 ----
508 If you have multi-factor authentication set up on your Gmail account, you can
509 generate an app-specific password for use with 'git send-email'. Visit
510 https://security.google.com/settings/security/apppasswords to create it.
512 Once your commits are ready to be sent to the mailing list, run the
513 following commands:
515         $ git format-patch --cover-letter -M origin/master -o outgoing/
516         $ edit outgoing/0000-*
517         $ git send-email outgoing/*
519 The first time you run it, you will be prompted for your credentials.  Enter the
520 app-specific or your regular password as appropriate.  If you have credential
521 helper configured (see linkgit:git-credential[1]), the password will be saved in
522 the credential store so you won't have to type it the next time.
524 Note: the following core Perl modules that may be installed with your
525 distribution of Perl are required:
526 MIME::Base64, MIME::QuotedPrint, Net::Domain and Net::SMTP.
527 These additional Perl modules are also required:
528 Authen::SASL and Mail::Address.
531 SEE ALSO
532 --------
533 linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)
537 Part of the linkgit:git[1] suite