1GIT-SEND-EMAIL(1)                 Git Manual                 GIT-SEND-EMAIL(1)
2
3
4

NAME

6       git-send-email - Send a collection of patches as emails
7

SYNOPSIS

9       git send-email [<options>] <file|directory|rev-list options>...
10       git send-email --dump-aliases
11
12

DESCRIPTION

14       Takes the patches given on the command line and emails them out.
15       Patches can be specified as files, directories (which will send all
16       files in the directory), or directly as a revision list. In the last
17       case, any format accepted by git-format-patch(1) can be passed to git
18       send-email.
19
20       The header of the email is configurable via command-line options. If
21       not specified on the command line, the user will be prompted with a
22       ReadLine enabled interface to provide the necessary information.
23
24       There are two formats accepted for patch files:
25
26        1. mbox format files
27
28           This is what git-format-patch(1) generates. Most headers and MIME
29           formatting are ignored.
30
31        2. The original format used by Greg Kroah-Hartman’s
32           send_lots_of_email.pl script
33
34           This format expects the first line of the file to contain the "Cc:"
35           value and the "Subject:" of the message as the second line.
36

OPTIONS

38   Composing
39       --annotate
40           Review and edit each patch you’re about to send. Default is the
41           value of sendemail.annotate. See the CONFIGURATION section for
42           sendemail.multiEdit.
43
44       --bcc=<address>,...
45           Specify a "Bcc:" value for each email. Default is the value of
46           sendemail.bcc.
47
48           This option may be specified multiple times.
49
50       --cc=<address>,...
51           Specify a starting "Cc:" value for each email. Default is the value
52           of sendemail.cc.
53
54           This option may be specified multiple times.
55
56       --compose
57           Invoke a text editor (see GIT_EDITOR in git-var(1)) to edit an
58           introductory message for the patch series.
59
60           When --compose is used, git send-email will use the From, Subject,
61           and In-Reply-To headers specified in the message. If the body of
62           the message (what you type after the headers and a blank line) only
63           contains blank (or Git: prefixed) lines, the summary won’t be sent,
64           but From, Subject, and In-Reply-To headers will be used unless they
65           are removed.
66
67           Missing From or In-Reply-To headers will be prompted for.
68
69           See the CONFIGURATION section for sendemail.multiEdit.
70
71       --from=<address>
72           Specify the sender of the emails. If not specified on the command
73           line, the value of the sendemail.from configuration option is used.
74           If neither the command-line option nor sendemail.from are set, then
75           the user will be prompted for the value. The default for the prompt
76           will be the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if
77           that is not set, as returned by "git var -l".
78
79       --reply-to=<address>
80           Specify the address where replies from recipients should go to. Use
81           this if replies to messages should go to another address than what
82           is specified with the --from parameter.
83
84       --in-reply-to=<identifier>
85           Make the first mail (or all the mails with --no-thread) appear as a
86           reply to the given Message-Id, which avoids breaking threads to
87           provide a new patch series. The second and subsequent emails will
88           be sent as replies according to the --[no-]chain-reply-to setting.
89
90           So for example when --thread and --no-chain-reply-to are specified,
91           the second and subsequent patches will be replies to the first one
92           like in the illustration below where [PATCH v2 0/3] is in reply to
93           [PATCH 0/2]:
94
95               [PATCH 0/2] Here is what I did...
96                 [PATCH 1/2] Clean up and tests
97                 [PATCH 2/2] Implementation
98                 [PATCH v2 0/3] Here is a reroll
99                   [PATCH v2 1/3] Clean up
100                   [PATCH v2 2/3] New tests
101                   [PATCH v2 3/3] Implementation
102
103           Only necessary if --compose is also set. If --compose is not set,
104           this will be prompted for.
105
106       --subject=<string>
107           Specify the initial subject of the email thread. Only necessary if
108           --compose is also set. If --compose is not set, this will be
109           prompted for.
110
111       --to=<address>,...
112           Specify the primary recipient of the emails generated. Generally,
113           this will be the upstream maintainer of the project involved.
114           Default is the value of the sendemail.to configuration value; if
115           that is unspecified, and --to-cmd is not specified, this will be
116           prompted for.
117
118           This option may be specified multiple times.
119
120       --8bit-encoding=<encoding>
121           When encountering a non-ASCII message or subject that does not
122           declare its encoding, add headers/quoting to indicate it is encoded
123           in <encoding>. Default is the value of the
124           sendemail.assume8bitEncoding; if that is unspecified, this will be
125           prompted for if any non-ASCII files are encountered.
126
127           Note that no attempts whatsoever are made to validate the encoding.
128
129       --compose-encoding=<encoding>
130           Specify encoding of compose message. Default is the value of the
131           sendemail.composeencoding; if that is unspecified, UTF-8 is
132           assumed.
133
134       --transfer-encoding=(7bit|8bit|quoted-printable|base64)
135           Specify the transfer encoding to be used to send the message over
136           SMTP. 7bit will fail upon encountering a non-ASCII message.
137           quoted-printable can be useful when the repository contains files
138           that contain carriage returns, but makes the raw patch email file
139           (as saved from a MUA) much harder to inspect manually. base64 is
140           even more fool proof, but also even more opaque. Default is the
141           value of the sendemail.transferEncoding configuration value; if
142           that is unspecified, git will use 8bit and not add a
143           Content-Transfer-Encoding header.
144
145       --xmailer, --no-xmailer
146           Add (or prevent adding) the "X-Mailer:" header. By default, the
147           header is added, but it can be turned off by setting the
148           sendemail.xmailer configuration variable to false.
149
150   Sending
151       --envelope-sender=<address>
152           Specify the envelope sender used to send the emails. This is useful
153           if your default address is not the address that is subscribed to a
154           list. In order to use the From address, set the value to "auto". If
155           you use the sendmail binary, you must have suitable privileges for
156           the -f parameter. Default is the value of the
157           sendemail.envelopeSender configuration variable; if that is
158           unspecified, choosing the envelope sender is left to your MTA.
159
160       --smtp-encryption=<encryption>
161           Specify the encryption to use, either ssl or tls. Any other value
162           reverts to plain SMTP. Default is the value of
163           sendemail.smtpEncryption.
164
165       --smtp-domain=<FQDN>
166           Specifies the Fully Qualified Domain Name (FQDN) used in the
167           HELO/EHLO command to the SMTP server. Some servers require the FQDN
168           to match your IP address. If not set, git send-email attempts to
169           determine your FQDN automatically. Default is the value of
170           sendemail.smtpDomain.
171
172       --smtp-auth=<mechanisms>
173           Whitespace-separated list of allowed SMTP-AUTH mechanisms. This
174           setting forces using only the listed mechanisms. Example:
175
176               $ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...
177
178           If at least one of the specified mechanisms matches the ones
179           advertised by the SMTP server and if it is supported by the
180           utilized SASL library, the mechanism is used for authentication. If
181           neither sendemail.smtpAuth nor --smtp-auth is specified, all
182           mechanisms supported by the SASL library can be used.
183
184       --smtp-pass[=<password>]
185           Password for SMTP-AUTH. The argument is optional: If no argument is
186           specified, then the empty string is used as the password. Default
187           is the value of sendemail.smtpPass, however --smtp-pass always
188           overrides this value.
189
190           Furthermore, passwords need not be specified in configuration files
191           or on the command line. If a username has been specified (with
192           --smtp-user or a sendemail.smtpUser), but no password has been
193           specified (with --smtp-pass or sendemail.smtpPass), then a password
194           is obtained using git-credential.
195
196       --smtp-server=<host>
197           If set, specifies the outgoing SMTP server to use (e.g.
198           smtp.example.com or a raw IP address). Alternatively it can specify
199           a full pathname of a sendmail-like program instead; the program
200           must support the -i option. Default value can be specified by the
201           sendemail.smtpServer configuration option; the built-in default is
202           to search for sendmail in /usr/sbin, /usr/lib and $PATH if such
203           program is available, falling back to localhost otherwise.
204
205       --smtp-server-port=<port>
206           Specifies a port different from the default port (SMTP servers
207           typically listen to smtp port 25, but may also listen to submission
208           port 587, or the common SSL smtp port 465); symbolic port names
209           (e.g. "submission" instead of 587) are also accepted. The port can
210           also be set with the sendemail.smtpServerPort configuration
211           variable.
212
213       --smtp-server-option=<option>
214           If set, specifies the outgoing SMTP server option to use. Default
215           value can be specified by the sendemail.smtpServerOption
216           configuration option.
217
218           The --smtp-server-option option must be repeated for each option
219           you want to pass to the server. Likewise, different lines in the
220           configuration files must be used for each option.
221
222       --smtp-ssl
223           Legacy alias for --smtp-encryption ssl.
224
225       --smtp-ssl-cert-path
226           Path to a store of trusted CA certificates for SMTP SSL/TLS
227           certificate validation (either a directory that has been processed
228           by c_rehash, or a single file containing one or more PEM format
229           certificates concatenated together: see verify(1) -CAfile and
230           -CApath for more information on these). Set it to an empty string
231           to disable certificate verification. Defaults to the value of the
232           sendemail.smtpsslcertpath configuration variable, if set, or the
233           backing SSL library’s compiled-in default otherwise (which should
234           be the best choice on most platforms).
235
236       --smtp-user=<user>
237           Username for SMTP-AUTH. Default is the value of sendemail.smtpUser;
238           if a username is not specified (with --smtp-user or
239           sendemail.smtpUser), then authentication is not attempted.
240
241       --smtp-debug=0|1
242           Enable (1) or disable (0) debug output. If enabled, SMTP commands
243           and replies will be printed. Useful to debug TLS connection and
244           authentication problems.
245
246       --batch-size=<num>
247           Some email servers (e.g. smtp.163.com) limit the number emails to
248           be sent per session (connection) and this will lead to a failure
249           when sending many messages. With this option, send-email will
250           disconnect after sending $<num> messages and wait for a few seconds
251           (see --relogin-delay) and reconnect, to work around such a limit.
252           You may want to use some form of credential helper to avoid having
253           to retype your password every time this happens. Defaults to the
254           sendemail.smtpBatchSize configuration variable.
255
256       --relogin-delay=<int>
257           Waiting $<int> seconds before reconnecting to SMTP server. Used
258           together with --batch-size option. Defaults to the
259           sendemail.smtpReloginDelay configuration variable.
260
261   Automating
262       --to-cmd=<command>
263           Specify a command to execute once per patch file which should
264           generate patch file specific "To:" entries. Output of this command
265           must be single email address per line. Default is the value of
266           sendemail.tocmd configuration value.
267
268       --cc-cmd=<command>
269           Specify a command to execute once per patch file which should
270           generate patch file specific "Cc:" entries. Output of this command
271           must be single email address per line. Default is the value of
272           sendemail.ccCmd configuration value.
273
274       --[no-]chain-reply-to
275           If this is set, each email will be sent as a reply to the previous
276           email sent. If disabled with "--no-chain-reply-to", all emails
277           after the first will be sent as replies to the first email sent.
278           When using this, it is recommended that the first file given be an
279           overview of the entire patch series. Disabled by default, but the
280           sendemail.chainReplyTo configuration variable can be used to enable
281           it.
282
283       --identity=<identity>
284           A configuration identity. When given, causes values in the
285           sendemail.<identity> subsection to take precedence over values in
286           the sendemail section. The default identity is the value of
287           sendemail.identity.
288
289       --[no-]signed-off-by-cc
290           If this is set, add emails found in Signed-off-by: or Cc: lines to
291           the cc list. Default is the value of sendemail.signedoffbycc
292           configuration value; if that is unspecified, default to
293           --signed-off-by-cc.
294
295       --[no-]cc-cover
296           If this is set, emails found in Cc: headers in the first patch of
297           the series (typically the cover letter) are added to the cc list
298           for each email set. Default is the value of sendemail.cccover
299           configuration value; if that is unspecified, default to
300           --no-cc-cover.
301
302       --[no-]to-cover
303           If this is set, emails found in To: headers in the first patch of
304           the series (typically the cover letter) are added to the to list
305           for each email set. Default is the value of sendemail.tocover
306           configuration value; if that is unspecified, default to
307           --no-to-cover.
308
309       --suppress-cc=<category>
310           Specify an additional category of recipients to suppress the
311           auto-cc of:
312
313           ·   author will avoid including the patch author
314
315           ·   self will avoid including the sender
316
317           ·   cc will avoid including anyone mentioned in Cc lines in the
318               patch header except for self (use self for that).
319
320           ·   bodycc will avoid including anyone mentioned in Cc lines in the
321               patch body (commit message) except for self (use self for
322               that).
323
324           ·   sob will avoid including anyone mentioned in Signed-off-by
325               lines except for self (use self for that).
326
327           ·   cccmd will avoid running the --cc-cmd.
328
329           ·   body is equivalent to sob + bodycc
330
331           ·   all will suppress all auto cc values.
332
333           Default is the value of sendemail.suppresscc configuration value;
334           if that is unspecified, default to self if --suppress-from is
335           specified, as well as body if --no-signed-off-cc is specified.
336
337       --[no-]suppress-from
338           If this is set, do not add the From: address to the cc: list.
339           Default is the value of sendemail.suppressFrom configuration value;
340           if that is unspecified, default to --no-suppress-from.
341
342       --[no-]thread
343           If this is set, the In-Reply-To and References headers will be
344           added to each email sent. Whether each mail refers to the previous
345           email (deep threading per git format-patch wording) or to the first
346           email (shallow threading) is governed by "--[no-]chain-reply-to".
347
348           If disabled with "--no-thread", those headers will not be added
349           (unless specified with --in-reply-to). Default is the value of the
350           sendemail.thread configuration value; if that is unspecified,
351           default to --thread.
352
353           It is up to the user to ensure that no In-Reply-To header already
354           exists when git send-email is asked to add it (especially note that
355           git format-patch can be configured to do the threading itself).
356           Failure to do so may not produce the expected result in the
357           recipient’s MUA.
358
359   Administering
360       --confirm=<mode>
361           Confirm just before sending:
362
363           ·   always will always confirm before sending
364
365           ·   never will never confirm before sending
366
367           ·   cc will confirm before sending when send-email has
368               automatically added addresses from the patch to the Cc list
369
370           ·   compose will confirm before sending the first message when
371               using --compose.
372
373           ·   auto is equivalent to cc + compose
374
375           Default is the value of sendemail.confirm configuration value; if
376           that is unspecified, default to auto unless any of the suppress
377           options have been specified, in which case default to compose.
378
379       --dry-run
380           Do everything except actually send the emails.
381
382       --[no-]format-patch
383           When an argument may be understood either as a reference or as a
384           file name, choose to understand it as a format-patch argument
385           (--format-patch) or as a file name (--no-format-patch). By default,
386           when such a conflict occurs, git send-email will fail.
387
388       --quiet
389           Make git-send-email less verbose. One line per email should be all
390           that is output.
391
392       --[no-]validate
393           Perform sanity checks on patches. Currently, validation means the
394           following:
395
396           ·   Invoke the sendemail-validate hook if present (see
397               githooks(5)).
398
399           ·   Warn of patches that contain lines longer than 998 characters;
400               this is due to SMTP limits as described by
401               http://www.ietf.org/rfc/rfc2821.txt.
402
403           Default is the value of sendemail.validate; if this is not set,
404           default to --validate.
405
406       --force
407           Send emails even if safety checks would prevent it.
408
409   Information
410       --dump-aliases
411           Instead of the normal operation, dump the shorthand alias names
412           from the configured alias file(s), one per line in alphabetical
413           order. Note, this only includes the alias name and not its expanded
414           email addresses. See sendemail.aliasesfile for more information
415           about aliases.
416

CONFIGURATION

418       sendemail.aliasesFile
419           To avoid typing long email addresses, point this to one or more
420           email aliases files. You must also supply sendemail.aliasFileType.
421
422       sendemail.aliasFileType
423           Format of the file(s) specified in sendemail.aliasesFile. Must be
424           one of mutt, mailrc, pine, elm, or gnus, or sendmail.
425
426           What an alias file in each format looks like can be found in the
427           documentation of the email program of the same name. The
428           differences and limitations from the standard formats are described
429           below:
430
431           sendmail
432
433               ·   Quoted aliases and quoted addresses are not supported:
434                   lines that contain a " symbol are ignored.
435
436               ·   Redirection to a file (/path/name) or pipe (|command) is
437                   not supported.
438
439               ·   File inclusion (:include: /path/name) is not supported.
440
441               ·   Warnings are printed on the standard error output for any
442                   explicitly unsupported constructs, and any other lines that
443                   are not recognized by the parser.
444
445       sendemail.multiEdit
446           If true (default), a single editor instance will be spawned to edit
447           files you have to edit (patches when --annotate is used, and the
448           summary when --compose is used). If false, files will be edited one
449           after the other, spawning a new editor each time.
450
451       sendemail.confirm
452           Sets the default for whether to confirm before sending. Must be one
453           of always, never, cc, compose, or auto. See --confirm in the
454           previous section for the meaning of these values.
455

EXAMPLES

457   Use gmail as the smtp server
458       To use git send-email to send your patches through the GMail SMTP
459       server, edit ~/.gitconfig to specify your account settings:
460
461           [sendemail]
462                   smtpEncryption = tls
463                   smtpServer = smtp.gmail.com
464                   smtpUser = yourname@gmail.com
465                   smtpServerPort = 587
466
467       If you have multifactor authentication setup on your gmail account, you
468       will need to generate an app-specific password for use with git
469       send-email. Visit
470       https://security.google.com/settings/security/apppasswords to create
471       it.
472
473       Once your commits are ready to be sent to the mailing list, run the
474       following commands:
475
476           $ git format-patch --cover-letter -M origin/master -o outgoing/
477           $ edit outgoing/0000-*
478           $ git send-email outgoing/*
479
480       The first time you run it, you will be prompted for your credentials.
481       Enter the app-specific or your regular password as appropriate. If you
482       have credential helper configured (see git-credential(1)), the password
483       will be saved in the credential store so you won’t have to type it the
484       next time.
485
486       Note: the following perl modules are required Net::SMTP::SSL,
487       MIME::Base64 and Authen::SASL
488

SEE ALSO

490       git-format-patch(1), git-imap-send(1), mbox(5)
491

GIT

493       Part of the git(1) suite
494
495
496
497Git 2.18.1                        05/14/2019                 GIT-SEND-EMAIL(1)
Impressum