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/>
10 .TH "GIT\-SEND\-EMAIL" "1" "2023\-06\-01" "Git 2\&.41\&.0" "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 \-\-header\-cmd=<command>
413 Specify a command that is executed once per outgoing message and output RFC 2822 style header lines to be inserted into them\&. When the
414 \fBsendemail\&.headerCmd\fR
415 configuration variable is set, its value is always used\&. When \-\-header\-cmd is provided at the command line, its value takes precedence over the
416 \fBsendemail\&.headerCmd\fR
417 configuration variable\&.
422 Disable any header command in use\&.
425 \-\-[no\-]chain\-reply\-to
427 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
428 \fBsendemail\&.chainReplyTo\fR
429 configuration variable can be used to enable it\&.
432 \-\-identity=<identity>
434 A configuration identity\&. When given, causes values in the
435 \fIsendemail\&.<identity>\fR
436 subsection to take precedence over values in the
438 section\&. The default identity is the value of
439 \fBsendemail\&.identity\fR\&.
442 \-\-[no\-]signed\-off\-by\-cc
444 If this is set, add emails found in the
445 \fBSigned\-off\-by\fR
446 trailer or Cc: lines to the cc list\&. Default is the value of
447 \fBsendemail\&.signedoffbycc\fR
448 configuration value; if that is unspecified, default to \-\-signed\-off\-by\-cc\&.
453 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
454 \fIsendemail\&.cccover\fR
455 configuration value; if that is unspecified, default to \-\-no\-cc\-cover\&.
460 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
461 \fIsendemail\&.tocover\fR
462 configuration value; if that is unspecified, default to \-\-no\-to\-cover\&.
465 \-\-suppress\-cc=<category>
467 Specify an additional category of recipients to suppress the auto\-cc of:
478 will avoid including the patch author\&.
490 will avoid including the sender\&.
502 will avoid including anyone mentioned in Cc lines in the patch header except for self (use
516 will avoid including anyone mentioned in Cc lines in the patch body (commit message) except for self (use
530 will avoid including anyone mentioned in the Signed\-off\-by trailers except for self (use
544 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
558 will avoid running the \-\-cc\-cmd\&.
587 will suppress all auto cc values\&.
590 Default is the value of
591 \fBsendemail\&.suppresscc\fR
592 configuration value; if that is unspecified, default to
594 if \-\-suppress\-from is specified, as well as
596 if \-\-no\-signed\-off\-cc is specified\&.
599 \-\-[no\-]suppress\-from
601 If this is set, do not add the From: address to the cc: list\&. Default is the value of
602 \fBsendemail\&.suppressFrom\fR
603 configuration value; if that is unspecified, default to \-\-no\-suppress\-from\&.
608 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
610 \fIgit format\-patch\fR
611 wording) or to the first email (\fBshallow\fR
612 threading) is governed by "\-\-[no\-]chain\-reply\-to"\&.
614 If disabled with "\-\-no\-thread", those headers will not be added (unless specified with \-\-in\-reply\-to)\&. Default is the value of the
615 \fBsendemail\&.thread\fR
616 configuration value; if that is unspecified, default to \-\-thread\&.
618 It is up to the user to ensure that no In\-Reply\-To header already exists when
619 \fIgit send\-email\fR
620 is asked to add it (especially note that
621 \fIgit format\-patch\fR
622 can be configured to do the threading itself)\&. Failure to do so may not produce the expected result in the recipient\(cqs MUA\&.
628 Confirm just before sending:
639 will always confirm before sending
651 will never confirm before sending
663 will confirm before sending when send\-email has automatically added addresses from the patch to the Cc list
675 will confirm before sending the first message when using \-\-compose\&.
693 Default is the value of
694 \fBsendemail\&.confirm\fR
695 configuration value; if that is unspecified, default to
697 unless any of the suppress options have been specified, in which case default to
703 Do everything except actually send the emails\&.
706 \-\-[no\-]format\-patch
708 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\&.
713 Make git\-send\-email less verbose\&. One line per email should be all that is output\&.
718 Perform sanity checks on patches\&. Currently, validation means the following:
728 Invoke the sendemail\-validate hook if present (see
729 \fBgithooks\fR(5))\&.
740 Warn of patches that contain lines longer than 998 characters unless a suitable transfer encoding (\fIauto\fR,
742 \fIquoted\-printable\fR) is used; this is due to SMTP limits as described by
743 \m[blue]\fBhttp://www\&.ietf\&.org/rfc/rfc5322\&.txt\fR\m[]\&.
746 Default is the value of
747 \fBsendemail\&.validate\fR; if this is not set, default to
748 \fB\-\-validate\fR\&.
753 Send emails even if safety checks would prevent it\&.
759 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
760 \fIsendemail\&.aliasesfile\fR
761 for more information about aliases\&.
765 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:
769 A configuration identity\&. When given, causes values in the
770 \fIsendemail\&.<identity>\fR
771 subsection to take precedence over values in the
773 section\&. The default identity is the value of
774 \fBsendemail\&.identity\fR\&.
777 sendemail\&.smtpEncryption
780 \fBgit-send-email\fR(1)
781 for description\&. Note that this setting is not subject to the
786 sendemail\&.smtpsslcertpath
788 Path to ca\-certificates (either a directory or a single file)\&. Set it to an empty string to disable certificate verification\&.
791 sendemail\&.<identity>\&.*
793 Identity\-specific versions of the
795 parameters found below, taking precedence over those when this identity is selected, through either the command\-line or
796 \fBsendemail\&.identity\fR\&.
799 sendemail\&.multiEdit
801 If true (default), a single editor instance will be spawned to edit files you have to edit (patches when
803 is used, and the summary when
805 is used)\&. If false, files will be edited one after the other, spawning a new editor each time\&.
810 Sets the default for whether to confirm before sending\&. Must be one of
818 \fBgit-send-email\fR(1)
819 documentation for the meaning of these values\&.
822 sendemail\&.aliasesFile
824 To avoid typing long email addresses, point this to one or more email aliases files\&. You must also supply
825 \fBsendemail\&.aliasFileType\fR\&.
828 sendemail\&.aliasFileType
830 Format of the file(s) specified in sendemail\&.aliasesFile\&. Must be one of
838 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:
851 Quoted aliases and quoted addresses are not supported: lines that contain a
853 symbol are ignored\&.
864 Redirection to a file (\fB/path/name\fR) or pipe (\fB|command\fR) is not supported\&.
875 File inclusion (\fB:include: /path/name\fR) is not supported\&.
886 Warnings are printed on the standard error output for any explicitly unsupported constructs, and any other lines that are not recognized by the parser\&.
891 sendemail\&.annotate, sendemail\&.bcc, sendemail\&.cc, sendemail\&.ccCmd, sendemail\&.chainReplyTo, sendemail\&.envelopeSender, sendemail\&.from, sendemail\&.headerCmd, 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
893 These configuration variables all provide a default for
894 \fBgit-send-email\fR(1)
895 command\-line options\&. See its documentation for details\&.
898 sendemail\&.signedoffcc (deprecated)
901 \fBsendemail\&.signedoffbycc\fR\&.
904 sendemail\&.smtpBatchSize
906 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
907 \fB\-\-batch\-size\fR
909 \fBgit-send-email\fR(1)\&.
912 sendemail\&.smtpReloginDelay
914 Seconds wait before reconnecting to smtp server\&. See also the
915 \fB\-\-relogin\-delay\fR
917 \fBgit-send-email\fR(1)\&.
920 sendemail\&.forbidSendmailVariables
922 To avoid common misconfiguration mistakes,
923 \fBgit-send-email\fR(1)
924 will abort with a warning if any configuration options for "sendmail" exist\&. Set this variable to bypass the check\&.
927 .SS "Use gmail as the smtp server"
929 To use \fIgit send\-email\fR to send your patches through the GMail SMTP server, edit ~/\&.gitconfig to specify your account settings:
937 smtpServer = smtp\&.gmail\&.com
938 smtpUser = yourname@gmail\&.com
946 If you have multi\-factor authentication set up on your Gmail account, you can 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\&.
948 Once your commits are ready to be sent to the mailing list, run the following commands:
954 $ git format\-patch \-\-cover\-letter \-M origin/master \-o outgoing/
955 $ edit outgoing/0000\-*
956 $ git send\-email outgoing/*
962 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\&.
964 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\&.
967 \fBgit-format-patch\fR(1), \fBgit-imap-send\fR(1), mbox(5)
970 Part of the \fBgit\fR(1) suite