2 .\" Title: git-send-email
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.37.1.223.g6a475b71f8
10 .TH "GIT\-SEND\-EMAIL" "1" "07/22/2022" "Git 2\&.37\&.1\&.223\&.g6a475b" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-send-email \- Send a collection of patches as emails
35 \fIgit send\-email\fR [<options>] <file|directory>\&...
36 \fIgit send\-email\fR [<options>] <format\-patch options>
37 \fIgit send\-email\fR \-\-dump\-aliases
42 Takes the patches given on the command line and emails them out\&. Patches can be specified as files, directories (which will send all files in the directory), or directly as a revision list\&. In the last case, any format accepted by \fBgit-format-patch\fR(1) can be passed to git send\-email, as well as options understood by \fBgit-format-patch\fR(1)\&.
44 The header of the email is configurable via command\-line options\&. If not specified on the command line, the user will be prompted with a ReadLine enabled interface to provide the necessary information\&.
46 There are two formats accepted for patch files:
59 \fBgit-format-patch\fR(1)
60 generates\&. Most headers and MIME formatting are ignored\&.
71 The original format used by Greg Kroah\-Hartman\(cqs
72 \fIsend_lots_of_email\&.pl\fR
75 This format expects the first line of the file to contain the "Cc:" value and the "Subject:" of the message as the second line\&.
82 Review and edit each patch you\(cqre about to send\&. Default is the value of
83 \fBsendemail\&.annotate\fR\&. See the CONFIGURATION section for
84 \fBsendemail\&.multiEdit\fR\&.
87 \-\-bcc=<address>,\&...
89 Specify a "Bcc:" value for each email\&. Default is the value of
90 \fBsendemail\&.bcc\fR\&.
92 This option may be specified multiple times\&.
95 \-\-cc=<address>,\&...
97 Specify a starting "Cc:" value for each email\&. Default is the value of
98 \fBsendemail\&.cc\fR\&.
100 This option may be specified multiple times\&.
105 Invoke a text editor (see GIT_EDITOR in
106 \fBgit-var\fR(1)) to edit an introductory message for the patch series\&.
110 is used, git send\-email will use the From, Subject, and In\-Reply\-To headers specified in the message\&. If the body of the message (what you type after the headers and a blank line) only contains blank (or Git: prefixed) lines, the summary won\(cqt be sent, but From, Subject, and In\-Reply\-To headers will be used unless they are removed\&.
112 Missing From or In\-Reply\-To headers will be prompted for\&.
114 See the CONFIGURATION section for
115 \fBsendemail\&.multiEdit\fR\&.
120 Specify the sender of the emails\&. If not specified on the command line, the value of the
121 \fBsendemail\&.from\fR
122 configuration option is used\&. If neither the command\-line option nor
123 \fBsendemail\&.from\fR
124 are set, then the user will be prompted for the value\&. The default for the prompt will be the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not set, as returned by "git var \-l"\&.
127 \-\-reply\-to=<address>
129 Specify the address where replies from recipients should go to\&. Use this if replies to messages should go to another address than what is specified with the \-\-from parameter\&.
132 \-\-in\-reply\-to=<identifier>
134 Make the first mail (or all the mails with
135 \fB\-\-no\-thread\fR) appear as a reply to the given Message\-Id, which avoids breaking threads to provide a new patch series\&. The second and subsequent emails will be sent as replies according to the
136 \fB\-\-[no\-]chain\-reply\-to\fR
142 \fB\-\-no\-chain\-reply\-to\fR
143 are specified, the second and subsequent patches will be replies to the first one like in the illustration below where
152 [PATCH 0/2] Here is what I did\&.\&.\&.
153 [PATCH 1/2] Clean up and tests
154 [PATCH 2/2] Implementation
155 [PATCH v2 0/3] Here is a reroll
156 [PATCH v2 1/3] Clean up
157 [PATCH v2 2/3] New tests
158 [PATCH v2 3/3] Implementation
164 Only necessary if \-\-compose is also set\&. If \-\-compose is not set, this will be prompted for\&.
169 Specify the initial subject of the email thread\&. Only necessary if \-\-compose is also set\&. If \-\-compose is not set, this will be prompted for\&.
172 \-\-to=<address>,\&...
174 Specify the primary recipient of the emails generated\&. Generally, this will be the upstream maintainer of the project involved\&. Default is the value of the
176 configuration value; if that is unspecified, and \-\-to\-cmd is not specified, this will be prompted for\&.
178 This option may be specified multiple times\&.
181 \-\-8bit\-encoding=<encoding>
183 When encountering a non\-ASCII message or subject that does not declare its encoding, add headers/quoting to indicate it is encoded in <encoding>\&. Default is the value of the
184 \fIsendemail\&.assume8bitEncoding\fR; if that is unspecified, this will be prompted for if any non\-ASCII files are encountered\&.
186 Note that no attempts whatsoever are made to validate the encoding\&.
189 \-\-compose\-encoding=<encoding>
191 Specify encoding of compose message\&. Default is the value of the
192 \fIsendemail\&.composeencoding\fR; if that is unspecified, UTF\-8 is assumed\&.
195 \-\-transfer\-encoding=(7bit|8bit|quoted\-printable|base64|auto)
197 Specify the transfer encoding to be used to send the message over SMTP\&. 7bit will fail upon encountering a non\-ASCII message\&. quoted\-printable can be useful when the repository contains files that contain carriage returns, but makes the raw patch email file (as saved from a MUA) much harder to inspect manually\&. base64 is even more fool proof, but also even more opaque\&. auto will use 8bit when possible, and quoted\-printable otherwise\&.
199 Default is the value of the
200 \fBsendemail\&.transferEncoding\fR
201 configuration value; if that is unspecified, default to
205 \-\-xmailer, \-\-no\-xmailer
207 Add (or prevent adding) the "X\-Mailer:" header\&. By default, the header is added, but it can be turned off by setting the
208 \fBsendemail\&.xmailer\fR
209 configuration variable to
214 \-\-envelope\-sender=<address>
216 Specify the envelope sender used to send the emails\&. This is useful if your default address is not the address that is subscribed to a list\&. In order to use the
218 address, set the value to "auto"\&. If you use the sendmail binary, you must have suitable privileges for the \-f parameter\&. Default is the value of the
219 \fBsendemail\&.envelopeSender\fR
220 configuration variable; if that is unspecified, choosing the envelope sender is left to your MTA\&.
223 \-\-sendmail\-cmd=<command>
225 Specify a command to run to send the email\&. The command should be sendmail\-like; specifically, it must support the
227 option\&. The command will be executed in the shell if necessary\&. Default is the value of
228 \fBsendemail\&.sendmailcmd\fR\&. If unspecified, and if \-\-smtp\-server is also unspecified, git\-send\-email will search for
236 \-\-smtp\-encryption=<encryption>
238 Specify the encryption to use, either
241 \fItls\fR\&. Any other value reverts to plain SMTP\&. Default is the value of
242 \fBsendemail\&.smtpEncryption\fR\&.
245 \-\-smtp\-domain=<FQDN>
247 Specifies the Fully Qualified Domain Name (FQDN) used in the HELO/EHLO command to the SMTP server\&. Some servers require the FQDN to match your IP address\&. If not set, git send\-email attempts to determine your FQDN automatically\&. Default is the value of
248 \fBsendemail\&.smtpDomain\fR\&.
251 \-\-smtp\-auth=<mechanisms>
253 Whitespace\-separated list of allowed SMTP\-AUTH mechanisms\&. This setting forces using only the listed mechanisms\&. Example:
259 $ git send\-email \-\-smtp\-auth="PLAIN LOGIN GSSAPI" \&.\&.\&.
265 If at least one of the specified mechanisms matches the ones advertised by the SMTP server and if it is supported by the utilized SASL library, the mechanism is used for authentication\&. If neither
266 \fIsendemail\&.smtpAuth\fR
269 is specified, all mechanisms supported by the SASL library can be used\&. The special value
271 maybe specified to completely disable authentication independently of
275 \-\-smtp\-pass[=<password>]
277 Password for SMTP\-AUTH\&. The argument is optional: If no argument is specified, then the empty string is used as the password\&. Default is the value of
278 \fBsendemail\&.smtpPass\fR, however
280 always overrides this value\&.
282 Furthermore, passwords need not be specified in configuration files or on the command line\&. If a username has been specified (with
285 \fBsendemail\&.smtpUser\fR), but no password has been specified (with
288 \fBsendemail\&.smtpPass\fR), then a password is obtained using
289 \fIgit\-credential\fR\&.
294 Disable SMTP authentication\&. Short hand for
295 \fB\-\-smtp\-auth=none\fR
298 \-\-smtp\-server=<host>
300 If set, specifies the outgoing SMTP server to use (e\&.g\&.
301 \fBsmtp\&.example\&.com\fR
302 or a raw IP address)\&. If unspecified, and if
303 \fB\-\-sendmail\-cmd\fR
304 is also unspecified, the default is to search for
309 and $PATH if such a program is available, falling back to
313 For backward compatibility, this option can also specify a full pathname of a sendmail\-like program instead; the program must support the
315 option\&. This method does not support passing arguments or using plain command names\&. For those use cases, consider using
316 \fB\-\-sendmail\-cmd\fR
320 \-\-smtp\-server\-port=<port>
322 Specifies a port different from the default port (SMTP servers typically listen to smtp port 25, but may also listen to submission port 587, or the common SSL smtp port 465); symbolic port names (e\&.g\&. "submission" instead of 587) are also accepted\&. The port can also be set with the
323 \fBsendemail\&.smtpServerPort\fR
324 configuration variable\&.
327 \-\-smtp\-server\-option=<option>
329 If set, specifies the outgoing SMTP server option to use\&. Default value can be specified by the
330 \fBsendemail\&.smtpServerOption\fR
331 configuration option\&.
333 The \-\-smtp\-server\-option option must be repeated for each option you want to pass to the server\&. Likewise, different lines in the configuration files must be used for each option\&.
339 \fI\-\-smtp\-encryption ssl\fR\&.
342 \-\-smtp\-ssl\-cert\-path
344 Path to a store of trusted CA certificates for SMTP SSL/TLS certificate validation (either a directory that has been processed by
345 \fIc_rehash\fR, or a single file containing one or more PEM format certificates concatenated together: see verify(1) \-CAfile and \-CApath for more information on these)\&. Set it to an empty string to disable certificate verification\&. Defaults to the value of the
346 \fBsendemail\&.smtpsslcertpath\fR
347 configuration variable, if set, or the backing SSL library\(cqs compiled\-in default otherwise (which should be the best choice on most platforms)\&.
350 \-\-smtp\-user=<user>
352 Username for SMTP\-AUTH\&. Default is the value of
353 \fBsendemail\&.smtpUser\fR; if a username is not specified (with
356 \fBsendemail\&.smtpUser\fR), then authentication is not attempted\&.
361 Enable (1) or disable (0) debug output\&. If enabled, SMTP commands and replies will be printed\&. Useful to debug TLS connection and authentication problems\&.
364 \-\-batch\-size=<num>
366 Some email servers (e\&.g\&. smtp\&.163\&.com) limit the number emails to be sent per session (connection) and this will lead to a failure when sending many messages\&. With this option, send\-email will disconnect after sending $<num> messages and wait for a few seconds (see \-\-relogin\-delay) and reconnect, to work around such a limit\&. You may want to use some form of credential helper to avoid having to retype your password every time this happens\&. Defaults to the
367 \fBsendemail\&.smtpBatchSize\fR
368 configuration variable\&.
371 \-\-relogin\-delay=<int>
373 Waiting $<int> seconds before reconnecting to SMTP server\&. Used together with \-\-batch\-size option\&. Defaults to the
374 \fBsendemail\&.smtpReloginDelay\fR
375 configuration variable\&.
381 Clears any list of "To:", "Cc:", "Bcc:" addresses previously set via config\&.
386 Clears the previously read value of
387 \fBsendemail\&.identity\fR
388 set via config, if any\&.
391 \-\-to\-cmd=<command>
393 Specify a command to execute once per patch file which should generate patch file specific "To:" entries\&. Output of this command must be single email address per line\&. Default is the value of
394 \fIsendemail\&.tocmd\fR
395 configuration value\&.
398 \-\-cc\-cmd=<command>
400 Specify a command to execute once per patch file which should generate patch file specific "Cc:" entries\&. Output of this command must be single email address per line\&. Default is the value of
401 \fBsendemail\&.ccCmd\fR
402 configuration value\&.
405 \-\-[no\-]chain\-reply\-to
407 If this is set, each email will be sent as a reply to the previous email sent\&. If disabled with "\-\-no\-chain\-reply\-to", all emails after the first will be sent as replies to the first email sent\&. When using this, it is recommended that the first file given be an overview of the entire patch series\&. Disabled by default, but the
408 \fBsendemail\&.chainReplyTo\fR
409 configuration variable can be used to enable it\&.
412 \-\-identity=<identity>
414 A configuration identity\&. When given, causes values in the
415 \fIsendemail\&.<identity>\fR
416 subsection to take precedence over values in the
418 section\&. The default identity is the value of
419 \fBsendemail\&.identity\fR\&.
422 \-\-[no\-]signed\-off\-by\-cc
424 If this is set, add emails found in the
425 \fBSigned\-off\-by\fR
426 trailer or Cc: lines to the cc list\&. Default is the value of
427 \fBsendemail\&.signedoffbycc\fR
428 configuration value; if that is unspecified, default to \-\-signed\-off\-by\-cc\&.
433 If this is set, emails found in Cc: headers in the first patch of the series (typically the cover letter) are added to the cc list for each email set\&. Default is the value of
434 \fIsendemail\&.cccover\fR
435 configuration value; if that is unspecified, default to \-\-no\-cc\-cover\&.
440 If this is set, emails found in To: headers in the first patch of the series (typically the cover letter) are added to the to list for each email set\&. Default is the value of
441 \fIsendemail\&.tocover\fR
442 configuration value; if that is unspecified, default to \-\-no\-to\-cover\&.
445 \-\-suppress\-cc=<category>
447 Specify an additional category of recipients to suppress the auto\-cc of:
458 will avoid including the patch author\&.
470 will avoid including the sender\&.
482 will avoid including anyone mentioned in Cc lines in the patch header except for self (use
496 will avoid including anyone mentioned in Cc lines in the patch body (commit message) except for self (use
510 will avoid including anyone mentioned in the Signed\-off\-by trailers except for self (use
524 will avoid including anyone mentioned in Acked\-by, Reviewed\-by, Tested\-by and other "\-by" lines in the patch body, except Signed\-off\-by (use
538 will avoid running the \-\-cc\-cmd\&.
567 will suppress all auto cc values\&.
570 Default is the value of
571 \fBsendemail\&.suppresscc\fR
572 configuration value; if that is unspecified, default to
574 if \-\-suppress\-from is specified, as well as
576 if \-\-no\-signed\-off\-cc is specified\&.
579 \-\-[no\-]suppress\-from
581 If this is set, do not add the From: address to the cc: list\&. Default is the value of
582 \fBsendemail\&.suppressFrom\fR
583 configuration value; if that is unspecified, default to \-\-no\-suppress\-from\&.
588 If this is set, the In\-Reply\-To and References headers will be added to each email sent\&. Whether each mail refers to the previous email (\fBdeep\fR
590 \fIgit format\-patch\fR
591 wording) or to the first email (\fBshallow\fR
592 threading) is governed by "\-\-[no\-]chain\-reply\-to"\&.
594 If disabled with "\-\-no\-thread", those headers will not be added (unless specified with \-\-in\-reply\-to)\&. Default is the value of the
595 \fBsendemail\&.thread\fR
596 configuration value; if that is unspecified, default to \-\-thread\&.
598 It is up to the user to ensure that no In\-Reply\-To header already exists when
599 \fIgit send\-email\fR
600 is asked to add it (especially note that
601 \fIgit format\-patch\fR
602 can be configured to do the threading itself)\&. Failure to do so may not produce the expected result in the recipient\(cqs MUA\&.
608 Confirm just before sending:
619 will always confirm before sending
631 will never confirm before sending
643 will confirm before sending when send\-email has automatically added addresses from the patch to the Cc list
655 will confirm before sending the first message when using \-\-compose\&.
673 Default is the value of
674 \fBsendemail\&.confirm\fR
675 configuration value; if that is unspecified, default to
677 unless any of the suppress options have been specified, in which case default to
683 Do everything except actually send the emails\&.
686 \-\-[no\-]format\-patch
688 When an argument may be understood either as a reference or as a file name, choose to understand it as a format\-patch argument (\fB\-\-format\-patch\fR) or as a file name (\fB\-\-no\-format\-patch\fR)\&. By default, when such a conflict occurs, git send\-email will fail\&.
693 Make git\-send\-email less verbose\&. One line per email should be all that is output\&.
698 Perform sanity checks on patches\&. Currently, validation means the following:
708 Invoke the sendemail\-validate hook if present (see
709 \fBgithooks\fR(5))\&.
720 Warn of patches that contain lines longer than 998 characters unless a suitable transfer encoding (\fIauto\fR,
722 \fIquoted\-printable\fR) is used; this is due to SMTP limits as described by
723 \m[blue]\fBhttp://www\&.ietf\&.org/rfc/rfc5322\&.txt\fR\m[]\&.
726 Default is the value of
727 \fBsendemail\&.validate\fR; if this is not set, default to
728 \fB\-\-validate\fR\&.
733 Send emails even if safety checks would prevent it\&.
739 Instead of the normal operation, dump the shorthand alias names from the configured alias file(s), one per line in alphabetical order\&. Note, this only includes the alias name and not its expanded email addresses\&. See
740 \fIsendemail\&.aliasesfile\fR
741 for more information about aliases\&.
745 sendemail\&.aliasesFile
747 To avoid typing long email addresses, point this to one or more email aliases files\&. You must also supply
748 \fBsendemail\&.aliasFileType\fR\&.
751 sendemail\&.aliasFileType
753 Format of the file(s) specified in sendemail\&.aliasesFile\&. Must be one of
761 What an alias file in each format looks like can be found in the documentation of the email program of the same name\&. The differences and limitations from the standard formats are described below:
774 Quoted aliases and quoted addresses are not supported: lines that contain a
776 symbol are ignored\&.
787 Redirection to a file (\fB/path/name\fR) or pipe (\fB|command\fR) is not supported\&.
798 File inclusion (\fB:include: /path/name\fR) is not supported\&.
809 Warnings are printed on the standard error output for any explicitly unsupported constructs, and any other lines that are not recognized by the parser\&.
814 sendemail\&.multiEdit
816 If true (default), a single editor instance will be spawned to edit files you have to edit (patches when
818 is used, and the summary when
820 is used)\&. If false, files will be edited one after the other, spawning a new editor each time\&.
825 Sets the default for whether to confirm before sending\&. Must be one of
832 in the previous section for the meaning of these values\&.
835 .SS "Use gmail as the smtp server"
837 To use \fIgit send\-email\fR to send your patches through the GMail SMTP server, edit ~/\&.gitconfig to specify your account settings:
845 smtpServer = smtp\&.gmail\&.com
846 smtpUser = yourname@gmail\&.com
854 If you have multi\-factor authentication set up on your Gmail account, you will need to generate an app\-specific password for use with \fIgit send\-email\fR\&. Visit \m[blue]\fBhttps://security\&.google\&.com/settings/security/apppasswords\fR\m[] to create it\&.
856 If you do not have multi\-factor authentication set up on your Gmail account, you will need to allow less secure app access\&. Visit \m[blue]\fBhttps://myaccount\&.google\&.com/lesssecureapps\fR\m[] to enable it\&.
858 Once your commits are ready to be sent to the mailing list, run the following commands:
864 $ git format\-patch \-\-cover\-letter \-M origin/master \-o outgoing/
865 $ edit outgoing/0000\-*
866 $ git send\-email outgoing/*
872 The first time you run it, you will be prompted for your credentials\&. Enter the app\-specific or your regular password as appropriate\&. If you have credential helper configured (see \fBgit-credential\fR(1)), the password will be saved in the credential store so you won\(cqt have to type it the next time\&.
874 Note: the following core Perl modules that may be installed with your distribution of Perl are required: MIME::Base64, MIME::QuotedPrint, Net::Domain and Net::SMTP\&. These additional Perl modules are also required: Authen::SASL and Mail::Address\&.
877 \fBgit-format-patch\fR(1), \fBgit-imap-send\fR(1), mbox(5)
880 Part of the \fBgit\fR(1) suite