6 git-send-email - Send a collection of patches as emails
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
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:
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'
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.
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`.
57 Specify a "Bcc:" value for each email. Default is the value of
60 This option may be specified multiple times.
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.
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
79 Missing From or In-Reply-To headers will be prompted for.
81 See the CONFIGURATION section for `sendemail.multiEdit`.
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.
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.
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
153 Default is the value of the `sendemail.transferEncoding` configuration
154 value; if that is unspecified, default to `auto`.
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`.
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:
208 $ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...
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'.
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`
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.
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).
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.
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.
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.
308 Clears any list of "To:", "Cc:", "Bcc:" addresses previously
312 Clears the previously read value of `sendemail.identity` set
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.
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.
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.
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.
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
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.
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,
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
418 Use the mailmap file (see linkgit:gitmailmap[5]) to map all
419 addresses to their canonical real name and email address. Additional
420 mailmap data specific to git-send-email may be provided using the
421 `sendemail.mailmap.file` or `sendemail.mailmap.blob` configuration
422 values. Defaults to `sendemail.mailmap`.
428 Confirm just before sending:
431 - 'always' will always confirm before sending
432 - 'never' will never confirm before sending
433 - 'cc' will confirm before sending when send-email has automatically
434 added addresses from the patch to the Cc list
435 - 'compose' will confirm before sending the first message when using --compose.
436 - 'auto' is equivalent to 'cc' + 'compose'
439 Default is the value of `sendemail.confirm` configuration value; if that
440 is unspecified, default to 'auto' unless any of the suppress options
441 have been specified, in which case default to 'compose'.
444 Do everything except actually send the emails.
446 --[no-]format-patch::
447 When an argument may be understood either as a reference or as a file name,
448 choose to understand it as a format-patch argument (`--format-patch`)
449 or as a file name (`--no-format-patch`). By default, when such a conflict
450 occurs, git send-email will fail.
453 Make git-send-email less verbose. One line per email should be
457 Perform sanity checks on patches.
458 Currently, validation means the following:
461 * Invoke the sendemail-validate hook if present (see linkgit:githooks[5]).
462 * Warn of patches that contain lines longer than
463 998 characters unless a suitable transfer encoding
464 ('auto', 'base64', or 'quoted-printable') is used;
465 this is due to SMTP limits as described by
466 https://www.ietf.org/rfc/rfc5322.txt.
469 Default is the value of `sendemail.validate`; if this is not set,
470 default to `--validate`.
473 Send emails even if safety checks would prevent it.
480 Instead of the normal operation, dump the shorthand alias names from
481 the configured alias file(s), one per line in alphabetical order. Note
482 that this only includes the alias name and not its expanded email addresses.
483 See 'sendemail.aliasesFile' for more information about aliases.
485 --translate-aliases::
486 Instead of the normal operation, read from standard input and
487 interpret each line as an email alias. Translate it according to the
488 configured alias file(s). Output each translated name and email
489 address to standard output, one per line. See 'sendemail.aliasFile'
490 for more information about aliases.
495 include::includes/cmd-config-section-all.txt[]
497 include::config/sendemail.txt[]
501 Use gmail as the smtp server
502 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503 To use 'git send-email' to send your patches through the GMail SMTP server,
504 edit ~/.gitconfig to specify your account settings:
509 smtpServer = smtp.gmail.com
510 smtpUser = yourname@gmail.com
514 If you have multi-factor authentication set up on your Gmail account, you can
515 generate an app-specific password for use with 'git send-email'. Visit
516 https://security.google.com/settings/security/apppasswords to create it.
518 Once your commits are ready to be sent to the mailing list, run the
521 $ git format-patch --cover-letter -M origin/master -o outgoing/
522 $ edit outgoing/0000-*
523 $ git send-email outgoing/*
525 The first time you run it, you will be prompted for your credentials. Enter the
526 app-specific or your regular password as appropriate. If you have credential
527 helper configured (see linkgit:git-credential[1]), the password will be saved in
528 the credential store so you won't have to type it the next time.
530 Note: the following core Perl modules that may be installed with your
531 distribution of Perl are required:
532 MIME::Base64, MIME::QuotedPrint, Net::Domain and Net::SMTP.
533 These additional Perl modules are also required:
534 Authen::SASL and Mail::Address.
539 linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)
543 Part of the linkgit:git[1] suite