Home Explore Blog CI



git

8th chunk of `Documentation/git-send-email.adoc`
ec9cc26a059793fc4588cf55b0737395c1e2f8f90096c4cf0000000100000ec9
 one per line in alphabetical order. Note
	that this only includes the alias name and not its expanded email addresses.
	See 'sendemail.aliasesFile' for more information about aliases.

--translate-aliases::
	Instead of the normal operation, read from standard input and
	interpret each line as an email alias. Translate it according to the
	configured alias file(s). Output each translated name and email
	address to standard output, one per line. See 'sendemail.aliasFile'
	for more information about aliases.

CONFIGURATION
-------------

include::includes/cmd-config-section-all.adoc[]

include::config/sendemail.adoc[]

EXAMPLES OF SMTP SERVERS
------------------------
Use Gmail as the SMTP Server
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To use `git send-email` to send your patches through the Gmail SMTP server,
edit `~/.gitconfig` to specify your account settings:

----
[sendemail]
	smtpEncryption = tls
	smtpServer = smtp.gmail.com
	smtpUser = yourname@gmail.com
	smtpServerPort = 587
----

If you have multi-factor authentication set up on your Gmail account, you can
generate an app-specific password for use with 'git send-email'. Visit
https://security.google.com/settings/security/apppasswords to create it.

You can also use OAuth2.0 authentication with Gmail. `OAUTHBEARER` and
`XOAUTH2` are common methods used for this type of authentication. Gmail
supports both of them. As an example, if you want to use `OAUTHBEARER`, edit
your `~/.gitconfig` file and add `smtpAuth = OAUTHBEARER` to your account
settings:

----
[sendemail]
	smtpEncryption = tls
	smtpServer = smtp.gmail.com
	smtpUser = yourname@gmail.com
	smtpServerPort = 587
	smtpAuth = OAUTHBEARER
----

Use Microsoft Outlook as the SMTP Server
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.
Therefore, OAuth2.0 authentication must be used for Outlook. Also, it only
supports `XOAUTH2` authentication method.

Edit `~/.gitconfig` to specify your account settings for Outlook and use its
SMTP server with `git send-email`:

----
[sendemail]
	smtpEncryption = tls
	smtpServer = smtp.office365.com
	smtpUser = yourname@outlook.com
	smtpServerPort = 587
	smtpAuth = XOAUTH2
----

SENDING PATCHES
---------------
Once your commits are ready to be sent to the mailing list, run the
following commands:

	$ git format-patch --cover-letter -M origin/master -o outgoing/
	$ edit outgoing/0000-*
	$ git send-email outgoing/*

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 a credential helper configured (see linkgit:git-credential[1]), the
password will be saved in the credential store so you won't have to type it the
next time.

If you are using OAuth2.0 authentication, you need to use an access token in
place of a password when prompted. Various OAuth2.0 token generators are
available online. Community maintained credential helpers for Gmail and Outlook
are also available:

	- https://github.com/AdityaGarg8/git-credential-email[git-credential-gmail]
	  (cross platform, dedicated helper for authenticating Gmail accounts)

	- https://github.com/AdityaGarg8/git-credential-email[git-credential-outlook]
	  (cross platform, dedicated helper for authenticating Microsoft Outlook accounts)

You can also see linkgit:gitcredentials[7] for more OAuth based authentication
helpers.

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.


SEE ALSO
--------
linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)

GIT
---
Part of the linkgit:git[1] suite

Title: Git Send Email Configuration and Examples
Summary
This section provides information on configuring git send email, including alias translation, SMTP server settings for Gmail and Outlook, and OAuth2.0 authentication methods, as well as examples of sending patches and required Perl modules.