1GIT-SEND-EMAIL(1) Git Manual GIT-SEND-EMAIL(1)
2
3
4
6 git-send-email - Send a collection of patches as emails
7
9 git send-email [options] <file|directory|rev-list options>...
10
12 Takes the patches given on the command line and emails them out.
13 Patches can be specified as files, directories (which will send all
14 files in the directory), or directly as a revision list. In the last
15 case, any format accepted by git-format-patch(1) can be passed to git
16 send-email.
17
18 The header of the email is configurable by command line options. If not
19 specified on the command line, the user will be prompted with a
20 ReadLine enabled interface to provide the necessary information.
21
22 There are two formats accepted for patch files:
23
24 1. mbox format files
25
26 This is what git-format-patch(1) generates. Most headers and MIME
27 formatting are ignored.
28
29 2. The original format used by Greg Kroah-Hartman’s
30 send_lots_of_email.pl script
31
32 This format expects the first line of the file to contain the "Cc:"
33 value and the "Subject:" of the message as the second line.
34
36 Composing
37 --annotate
38 Review and edit each patch you’re about to send. See the
39 CONFIGURATION section for sendemail.multiedit.
40
41 --bcc=<address>
42 Specify a "Bcc:" value for each email. Default is the value of
43 sendemail.bcc.
44
45 The --bcc option must be repeated for each user you want on the bcc
46 list.
47
48 --cc=<address>
49 Specify a starting "Cc:" value for each email. Default is the value
50 of sendemail.cc.
51
52 The --cc option must be repeated for each user you want on the cc
53 list.
54
55 --compose
56 Invoke a text editor (see GIT_EDITOR in git-var(1)) to edit an
57 introductory message for the patch series.
58
59 When --compose is used, git send-email will use the From, Subject,
60 and In-Reply-To headers specified in the message. If the body of
61 the message (what you type after the headers and a blank line) only
62 contains blank (or GIT: prefixed) lines the summary won’t be sent,
63 but From, Subject, and In-Reply-To headers will be used unless they
64 are removed.
65
66 Missing From or In-Reply-To headers will be prompted for.
67
68 See the CONFIGURATION section for sendemail.multiedit.
69
70 --from=<address>
71 Specify the sender of the emails. If not specified on the command
72 line, the value of the sendemail.from configuration option is used.
73 If neither the command line option nor sendemail.from are set, then
74 the user will be prompted for the value. The default for the prompt
75 will be the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if
76 that is not set, as returned by "git var -l".
77
78 --in-reply-to=<identifier>
79 Make the first mail (or all the mails with --no-thread) appear as a
80 reply to the given Message-Id, which avoids breaking threads to
81 provide a new patch series. The second and subsequent emails will
82 be sent as replies according to the --[no]-chain-reply-to setting.
83
84 So for example when --thread and --no-chain-reply-to are specified,
85 the second and subsequent patches will be replies to the first one
86 like in the illustration below where [PATCH v2 0/3] is in reply to
87 [PATCH 0/2]:
88
89 [PATCH 0/2] Here is what I did...
90 [PATCH 1/2] Clean up and tests
91 [PATCH 2/2] Implementation
92 [PATCH v2 0/3] Here is a reroll
93 [PATCH v2 1/3] Clean up
94 [PATCH v2 2/3] New tests
95 [PATCH v2 3/3] Implementation
96
97 Only necessary if --compose is also set. If --compose is not set,
98 this will be prompted for.
99
100 --subject=<string>
101 Specify the initial subject of the email thread. Only necessary if
102 --compose is also set. If --compose is not set, this will be
103 prompted for.
104
105 --to=<address>
106 Specify the primary recipient of the emails generated. Generally,
107 this will be the upstream maintainer of the project involved.
108 Default is the value of the sendemail.to configuration value; if
109 that is unspecified, and --to-cmd is not specified, this will be
110 prompted for.
111
112 The --to option must be repeated for each user you want on the to
113 list.
114
115 --8bit-encoding=<encoding>
116 When encountering a non-ASCII message or subject that does not
117 declare its encoding, add headers/quoting to indicate it is encoded
118 in <encoding>. Default is the value of the
119 sendemail.assume8bitEncoding; if that is unspecified, this will be
120 prompted for if any non-ASCII files are encountered.
121
122 Note that no attempts whatsoever are made to validate the encoding.
123
124 Sending
125 --envelope-sender=<address>
126 Specify the envelope sender used to send the emails. This is useful
127 if your default address is not the address that is subscribed to a
128 list. In order to use the From address, set the value to "auto". If
129 you use the sendmail binary, you must have suitable privileges for
130 the -f parameter. Default is the value of the
131 sendemail.envelopesender configuration variable; if that is
132 unspecified, choosing the envelope sender is left to your MTA.
133
134 --smtp-encryption=<encryption>
135 Specify the encryption to use, either ssl or tls. Any other value
136 reverts to plain SMTP. Default is the value of
137 sendemail.smtpencryption.
138
139 --smtp-domain=<FQDN>
140 Specifies the Fully Qualified Domain Name (FQDN) used in the
141 HELO/EHLO command to the SMTP server. Some servers require the FQDN
142 to match your IP address. If not set, git send-email attempts to
143 determine your FQDN automatically. Default is the value of
144 sendemail.smtpdomain.
145
146 --smtp-pass[=<password>]
147 Password for SMTP-AUTH. The argument is optional: If no argument is
148 specified, then the empty string is used as the password. Default
149 is the value of sendemail.smtppass, however --smtp-pass always
150 overrides this value.
151
152 Furthermore, passwords need not be specified in configuration files
153 or on the command line. If a username has been specified (with
154 --smtp-user or a sendemail.smtpuser), but no password has been
155 specified (with --smtp-pass or sendemail.smtppass), then the user
156 is prompted for a password while the input is masked for privacy.
157
158 --smtp-server=<host>
159 If set, specifies the outgoing SMTP server to use (e.g.
160 smtp.example.com or a raw IP address). Alternatively it can specify
161 a full pathname of a sendmail-like program instead; the program
162 must support the -i option. Default value can be specified by the
163 sendemail.smtpserver configuration option; the built-in default is
164 /usr/sbin/sendmail or /usr/lib/sendmail if such program is
165 available, or localhost otherwise.
166
167 --smtp-server-port=<port>
168 Specifies a port different from the default port (SMTP servers
169 typically listen to smtp port 25, but may also listen to submission
170 port 587, or the common SSL smtp port 465); symbolic port names
171 (e.g. "submission" instead of 587) are also accepted. The port can
172 also be set with the sendemail.smtpserverport configuration
173 variable.
174
175 --smtp-server-option=<option>
176 If set, specifies the outgoing SMTP server option to use. Default
177 value can be specified by the sendemail.smtpserveroption
178 configuration option.
179
180 The --smtp-server-option option must be repeated for each option
181 you want to pass to the server. Likewise, different lines in the
182 configuration files must be used for each option.
183
184 --smtp-ssl
185 Legacy alias for --smtp-encryption ssl.
186
187 --smtp-user=<user>
188 Username for SMTP-AUTH. Default is the value of sendemail.smtpuser;
189 if a username is not specified (with --smtp-user or
190 sendemail.smtpuser), then authentication is not attempted.
191
192 Automating
193 --to-cmd=<command>
194 Specify a command to execute once per patch file which should
195 generate patch file specific "To:" entries. Output of this command
196 must be single email address per line. Default is the value of
197 sendemail.tocmd configuration value.
198
199 --cc-cmd=<command>
200 Specify a command to execute once per patch file which should
201 generate patch file specific "Cc:" entries. Output of this command
202 must be single email address per line. Default is the value of
203 sendemail.cccmd configuration value.
204
205 --[no-]chain-reply-to
206 If this is set, each email will be sent as a reply to the previous
207 email sent. If disabled with "--no-chain-reply-to", all emails
208 after the first will be sent as replies to the first email sent.
209 When using this, it is recommended that the first file given be an
210 overview of the entire patch series. Disabled by default, but the
211 sendemail.chainreplyto configuration variable can be used to enable
212 it.
213
214 --identity=<identity>
215 A configuration identity. When given, causes values in the
216 sendemail.<identity> subsection to take precedence over values in
217 the sendemail section. The default identity is the value of
218 sendemail.identity.
219
220 --[no-]signed-off-by-cc
221 If this is set, add emails found in Signed-off-by: or Cc: lines to
222 the cc list. Default is the value of sendemail.signedoffbycc
223 configuration value; if that is unspecified, default to
224 --signed-off-by-cc.
225
226 --suppress-cc=<category>
227 Specify an additional category of recipients to suppress the
228 auto-cc of:
229
230 · author will avoid including the patch author
231
232 · self will avoid including the sender
233
234 · cc will avoid including anyone mentioned in Cc lines in the
235 patch header except for self (use self for that).
236
237 · bodycc will avoid including anyone mentioned in Cc lines in
238 the patch body (commit message) except for self (use self for
239 that).
240
241 · sob will avoid including anyone mentioned in Signed-off-by
242 lines except for self (use self for that).
243
244 · cccmd will avoid running the --cc-cmd.
245
246 · body is equivalent to sob + bodycc
247
248 · all will suppress all auto cc values.
249
250 Default is the value of sendemail.suppresscc configuration value;
251 if that is unspecified, default to self if --suppress-from is
252 specified, as well as body if --no-signed-off-cc is specified.
253
254 --[no-]suppress-from
255 If this is set, do not add the From: address to the cc: list.
256 Default is the value of sendemail.suppressfrom configuration value;
257 if that is unspecified, default to --no-suppress-from.
258
259 --[no-]thread
260 If this is set, the In-Reply-To and References headers will be
261 added to each email sent. Whether each mail refers to the previous
262 email (deep threading per git format-patch wording) or to the first
263 email (shallow threading) is governed by "--[no-]chain-reply-to".
264
265 If disabled with "--no-thread", those headers will not be added
266 (unless specified with --in-reply-to). Default is the value of the
267 sendemail.thread configuration value; if that is unspecified,
268 default to --thread.
269
270 It is up to the user to ensure that no In-Reply-To header already
271 exists when git send-email is asked to add it (especially note that
272 git format-patch can be configured to do the threading itself).
273 Failure to do so may not produce the expected result in the
274 recipient’s MUA.
275
276 Administering
277 --confirm=<mode>
278 Confirm just before sending:
279
280 · always will always confirm before sending
281
282 · never will never confirm before sending
283
284 · cc will confirm before sending when send-email has
285 automatically added addresses from the patch to the Cc list
286
287 · compose will confirm before sending the first message when
288 using --compose.
289
290 · auto is equivalent to cc + compose
291
292 Default is the value of sendemail.confirm configuration value; if
293 that is unspecified, default to auto unless any of the suppress
294 options have been specified, in which case default to compose.
295
296 --dry-run
297 Do everything except actually send the emails.
298
299 --[no-]format-patch
300 When an argument may be understood either as a reference or as a
301 file name, choose to understand it as a format-patch argument
302 (--format-patch) or as a file name (--no-format-patch). By default,
303 when such a conflict occurs, git send-email will fail.
304
305 --quiet
306 Make git-send-email less verbose. One line per email should be all
307 that is output.
308
309 --[no-]validate
310 Perform sanity checks on patches. Currently, validation means the
311 following:
312
313 · Warn of patches that contain lines longer than 998 characters;
314 this is due to SMTP limits as described by
315 http://www.ietf.org/rfc/rfc2821.txt.
316
317 Default is the value of sendemail.validate; if this is not set,
318 default to --validate.
319
320 --force
321 Send emails even if safety checks would prevent it.
322
324 sendemail.aliasesfile
325 To avoid typing long email addresses, point this to one or more
326 email aliases files. You must also supply sendemail.aliasfiletype.
327
328 sendemail.aliasfiletype
329 Format of the file(s) specified in sendemail.aliasesfile. Must be
330 one of mutt, mailrc, pine, elm, or gnus.
331
332 sendemail.multiedit
333 If true (default), a single editor instance will be spawned to edit
334 files you have to edit (patches when --annotate is used, and the
335 summary when --compose is used). If false, files will be edited one
336 after the other, spawning a new editor each time.
337
338 sendemail.confirm
339 Sets the default for whether to confirm before sending. Must be one
340 of always, never, cc, compose, or auto. See --confirm in the
341 previous section for the meaning of these values.
342
344 Add the following section to the config file:
345
346 [sendemail]
347 smtpencryption = tls
348 smtpserver = smtp.gmail.com
349 smtpuser = yourname@gmail.com
350 smtpserverport = 587
351
352 Note: the following perl modules are required Net::SMTP::SSL,
353 MIME::Base64 and Authen::SASL
354
356 Written by Ryan Anderson <ryan@michonline.com[1]>
357
358 git-send-email is originally based upon send_lots_of_email.pl by Greg
359 Kroah-Hartman.
360
362 Documentation by Ryan Anderson
363
365 Part of the git(1) suite
366
368 1. ryan@michonline.com
369 mailto:ryan@michonline.com
370
371
372
373Git 1.7.4.4 04/11/2011 GIT-SEND-EMAIL(1)