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.39.1.231.ga7caae2729
10 .TH "GIT\-SEND\-EMAIL" "1" "01/17/2023" "Git 2\&.39\&.1\&.231\&.ga7caae" "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 in what way encrypting begins for the SMTP connection\&. Valid values are
241 \fItls\fR\&. Any other value reverts to plain (unencrypted) SMTP, which defaults to port 25\&. Despite the names, both values will use the same newer version of TLS, but for historic reasons have these names\&.
243 refers to "implicit" encryption (sometimes called SMTPS), that uses port 465 by default\&.
245 refers to "explicit" encryption (often known as STARTTLS), that uses port 25 by default\&. Other ports might be used by the SMTP server, which are not the default\&. Commonly found alternative port for
247 and unencrypted is 587\&. You need to check your provider\(cqs documentation or your server configuration to make sure for your own case\&. Default is the value of
248 \fBsendemail\&.smtpEncryption\fR\&.
251 \-\-smtp\-domain=<FQDN>
253 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
254 \fBsendemail\&.smtpDomain\fR\&.
257 \-\-smtp\-auth=<mechanisms>
259 Whitespace\-separated list of allowed SMTP\-AUTH mechanisms\&. This setting forces using only the listed mechanisms\&. Example:
265 $ git send\-email \-\-smtp\-auth="PLAIN LOGIN GSSAPI" \&.\&.\&.
271 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
272 \fIsendemail\&.smtpAuth\fR
275 is specified, all mechanisms supported by the SASL library can be used\&. The special value
277 maybe specified to completely disable authentication independently of
281 \-\-smtp\-pass[=<password>]
283 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
284 \fBsendemail\&.smtpPass\fR, however
286 always overrides this value\&.
288 Furthermore, passwords need not be specified in configuration files or on the command line\&. If a username has been specified (with
291 \fBsendemail\&.smtpUser\fR), but no password has been specified (with
294 \fBsendemail\&.smtpPass\fR), then a password is obtained using
295 \fIgit\-credential\fR\&.
300 Disable SMTP authentication\&. Short hand for
301 \fB\-\-smtp\-auth=none\fR
304 \-\-smtp\-server=<host>
306 If set, specifies the outgoing SMTP server to use (e\&.g\&.
307 \fBsmtp\&.example\&.com\fR
308 or a raw IP address)\&. If unspecified, and if
309 \fB\-\-sendmail\-cmd\fR
310 is also unspecified, the default is to search for
315 and $PATH if such a program is available, falling back to
319 For backward compatibility, this option can also specify a full pathname of a sendmail\-like program instead; the program must support the
321 option\&. This method does not support passing arguments or using plain command names\&. For those use cases, consider using
322 \fB\-\-sendmail\-cmd\fR
326 \-\-smtp\-server\-port=<port>
328 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
329 \fBsendemail\&.smtpServerPort\fR
330 configuration variable\&.
333 \-\-smtp\-server\-option=<option>
335 If set, specifies the outgoing SMTP server option to use\&. Default value can be specified by the
336 \fBsendemail\&.smtpServerOption\fR
337 configuration option\&.
339 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\&.
345 \fI\-\-smtp\-encryption ssl\fR\&.
348 \-\-smtp\-ssl\-cert\-path
350 Path to a store of trusted CA certificates for SMTP SSL/TLS certificate validation (either a directory that has been processed by
351 \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
352 \fBsendemail\&.smtpsslcertpath\fR
353 configuration variable, if set, or the backing SSL library\(cqs compiled\-in default otherwise (which should be the best choice on most platforms)\&.
356 \-\-smtp\-user=<user>
358 Username for SMTP\-AUTH\&. Default is the value of
359 \fBsendemail\&.smtpUser\fR; if a username is not specified (with
362 \fBsendemail\&.smtpUser\fR), then authentication is not attempted\&.
367 Enable (1) or disable (0) debug output\&. If enabled, SMTP commands and replies will be printed\&. Useful to debug TLS connection and authentication problems\&.
370 \-\-batch\-size=<num>
372 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
373 \fBsendemail\&.smtpBatchSize\fR
374 configuration variable\&.
377 \-\-relogin\-delay=<int>
379 Waiting $<int> seconds before reconnecting to SMTP server\&. Used together with \-\-batch\-size option\&. Defaults to the
380 \fBsendemail\&.smtpReloginDelay\fR
381 configuration variable\&.
387 Clears any list of "To:", "Cc:", "Bcc:" addresses previously set via config\&.
392 Clears the previously read value of
393 \fBsendemail\&.identity\fR
394 set via config, if any\&.
397 \-\-to\-cmd=<command>
399 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
400 \fIsendemail\&.tocmd\fR
401 configuration value\&.
404 \-\-cc\-cmd=<command>
406 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
407 \fBsendemail\&.ccCmd\fR
408 configuration value\&.
411 \-\-[no\-]chain\-reply\-to
413 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
414 \fBsendemail\&.chainReplyTo\fR
415 configuration variable can be used to enable it\&.
418 \-\-identity=<identity>
420 A configuration identity\&. When given, causes values in the
421 \fIsendemail\&.<identity>\fR
422 subsection to take precedence over values in the
424 section\&. The default identity is the value of
425 \fBsendemail\&.identity\fR\&.
428 \-\-[no\-]signed\-off\-by\-cc
430 If this is set, add emails found in the
431 \fBSigned\-off\-by\fR
432 trailer or Cc: lines to the cc list\&. Default is the value of
433 \fBsendemail\&.signedoffbycc\fR
434 configuration value; if that is unspecified, default to \-\-signed\-off\-by\-cc\&.
439 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
440 \fIsendemail\&.cccover\fR
441 configuration value; if that is unspecified, default to \-\-no\-cc\-cover\&.
446 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
447 \fIsendemail\&.tocover\fR
448 configuration value; if that is unspecified, default to \-\-no\-to\-cover\&.
451 \-\-suppress\-cc=<category>
453 Specify an additional category of recipients to suppress the auto\-cc of:
464 will avoid including the patch author\&.
476 will avoid including the sender\&.
488 will avoid including anyone mentioned in Cc lines in the patch header except for self (use
502 will avoid including anyone mentioned in Cc lines in the patch body (commit message) except for self (use
516 will avoid including anyone mentioned in the Signed\-off\-by trailers except for self (use
530 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
544 will avoid running the \-\-cc\-cmd\&.
573 will suppress all auto cc values\&.
576 Default is the value of
577 \fBsendemail\&.suppresscc\fR
578 configuration value; if that is unspecified, default to
580 if \-\-suppress\-from is specified, as well as
582 if \-\-no\-signed\-off\-cc is specified\&.
585 \-\-[no\-]suppress\-from
587 If this is set, do not add the From: address to the cc: list\&. Default is the value of
588 \fBsendemail\&.suppressFrom\fR
589 configuration value; if that is unspecified, default to \-\-no\-suppress\-from\&.
594 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
596 \fIgit format\-patch\fR
597 wording) or to the first email (\fBshallow\fR
598 threading) is governed by "\-\-[no\-]chain\-reply\-to"\&.
600 If disabled with "\-\-no\-thread", those headers will not be added (unless specified with \-\-in\-reply\-to)\&. Default is the value of the
601 \fBsendemail\&.thread\fR
602 configuration value; if that is unspecified, default to \-\-thread\&.
604 It is up to the user to ensure that no In\-Reply\-To header already exists when
605 \fIgit send\-email\fR
606 is asked to add it (especially note that
607 \fIgit format\-patch\fR
608 can be configured to do the threading itself)\&. Failure to do so may not produce the expected result in the recipient\(cqs MUA\&.
614 Confirm just before sending:
625 will always confirm before sending
637 will never confirm before sending
649 will confirm before sending when send\-email has automatically added addresses from the patch to the Cc list
661 will confirm before sending the first message when using \-\-compose\&.
679 Default is the value of
680 \fBsendemail\&.confirm\fR
681 configuration value; if that is unspecified, default to
683 unless any of the suppress options have been specified, in which case default to
689 Do everything except actually send the emails\&.
692 \-\-[no\-]format\-patch
694 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\&.
699 Make git\-send\-email less verbose\&. One line per email should be all that is output\&.
704 Perform sanity checks on patches\&. Currently, validation means the following:
714 Invoke the sendemail\-validate hook if present (see
715 \fBgithooks\fR(5))\&.
726 Warn of patches that contain lines longer than 998 characters unless a suitable transfer encoding (\fIauto\fR,
728 \fIquoted\-printable\fR) is used; this is due to SMTP limits as described by
729 \m[blue]\fBhttp://www\&.ietf\&.org/rfc/rfc5322\&.txt\fR\m[]\&.
732 Default is the value of
733 \fBsendemail\&.validate\fR; if this is not set, default to
734 \fB\-\-validate\fR\&.
739 Send emails even if safety checks would prevent it\&.
745 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
746 \fIsendemail\&.aliasesfile\fR
747 for more information about aliases\&.
751 Everything below this line in this section is selectively included from the \fBgit-config\fR(1) documentation\&. The content is the same as what\(cqs found there:
755 A configuration identity\&. When given, causes values in the
756 \fIsendemail\&.<identity>\fR
757 subsection to take precedence over values in the
759 section\&. The default identity is the value of
760 \fBsendemail\&.identity\fR\&.
763 sendemail\&.smtpEncryption
766 \fBgit-send-email\fR(1)
767 for description\&. Note that this setting is not subject to the
772 sendemail\&.smtpsslcertpath
774 Path to ca\-certificates (either a directory or a single file)\&. Set it to an empty string to disable certificate verification\&.
777 sendemail\&.<identity>\&.*
779 Identity\-specific versions of the
781 parameters found below, taking precedence over those when this identity is selected, through either the command\-line or
782 \fBsendemail\&.identity\fR\&.
785 sendemail\&.multiEdit
787 If true (default), a single editor instance will be spawned to edit files you have to edit (patches when
789 is used, and the summary when
791 is used)\&. If false, files will be edited one after the other, spawning a new editor each time\&.
796 Sets the default for whether to confirm before sending\&. Must be one of
804 \fBgit-send-email\fR(1)
805 documentation for the meaning of these values\&.
808 sendemail\&.aliasesFile
810 To avoid typing long email addresses, point this to one or more email aliases files\&. You must also supply
811 \fBsendemail\&.aliasFileType\fR\&.
814 sendemail\&.aliasFileType
816 Format of the file(s) specified in sendemail\&.aliasesFile\&. Must be one of
824 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:
837 Quoted aliases and quoted addresses are not supported: lines that contain a
839 symbol are ignored\&.
850 Redirection to a file (\fB/path/name\fR) or pipe (\fB|command\fR) is not supported\&.
861 File inclusion (\fB:include: /path/name\fR) is not supported\&.
872 Warnings are printed on the standard error output for any explicitly unsupported constructs, and any other lines that are not recognized by the parser\&.
877 sendemail\&.annotate, sendemail\&.bcc, sendemail\&.cc, sendemail\&.ccCmd, sendemail\&.chainReplyTo, sendemail\&.envelopeSender, sendemail\&.from, sendemail\&.signedoffbycc, sendemail\&.smtpPass, sendemail\&.suppresscc, sendemail\&.suppressFrom, sendemail\&.to, sendemail\&.tocmd, sendemail\&.smtpDomain, sendemail\&.smtpServer, sendemail\&.smtpServerPort, sendemail\&.smtpServerOption, sendemail\&.smtpUser, sendemail\&.thread, sendemail\&.transferEncoding, sendemail\&.validate, sendemail\&.xmailer
879 These configuration variables all provide a default for
880 \fBgit-send-email\fR(1)
881 command\-line options\&. See its documentation for details\&.
884 sendemail\&.signedoffcc (deprecated)
887 \fBsendemail\&.signedoffbycc\fR\&.
890 sendemail\&.smtpBatchSize
892 Number of messages to be sent per connection, after that a relogin will happen\&. If the value is 0 or undefined, send all messages in one connection\&. See also the
893 \fB\-\-batch\-size\fR
895 \fBgit-send-email\fR(1)\&.
898 sendemail\&.smtpReloginDelay
900 Seconds wait before reconnecting to smtp server\&. See also the
901 \fB\-\-relogin\-delay\fR
903 \fBgit-send-email\fR(1)\&.
906 sendemail\&.forbidSendmailVariables
908 To avoid common misconfiguration mistakes,
909 \fBgit-send-email\fR(1)
910 will abort with a warning if any configuration options for "sendmail" exist\&. Set this variable to bypass the check\&.
913 .SS "Use gmail as the smtp server"
915 To use \fIgit send\-email\fR to send your patches through the GMail SMTP server, edit ~/\&.gitconfig to specify your account settings:
923 smtpServer = smtp\&.gmail\&.com
924 smtpUser = yourname@gmail\&.com
932 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\&.
934 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\&.
936 Once your commits are ready to be sent to the mailing list, run the following commands:
942 $ git format\-patch \-\-cover\-letter \-M origin/master \-o outgoing/
943 $ edit outgoing/0000\-*
944 $ git send\-email outgoing/*
950 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\&.
952 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\&.
955 \fBgit-format-patch\fR(1), \fBgit-imap-send\fR(1), mbox(5)
958 Part of the \fBgit\fR(1) suite