You only need to complete this step once for each machine you intend to send emails from.
git config --global --editto open your global configuration file in your default editor.
There are two possible ways of using Gmail with
First, make sure that two-factor authentication is enabled for your Google
account. Then, obtain an application-specific password
for git from the app passwords page. To store this password with git,
run this command:
git config --global sendemail.smtpPass 'your password'Next step is to add these details to your global configuration file:
[sendemail] smtpserver = smtp.gmail.com smtpuser = email@example.com smtpencryption = tls smtpserverport = 587Be sure to fill in your own email address under
It is still possible to use
git send-emailwithout two-factor authentication and application-specific password, but this requires installation and configuration of the special tool, which mimics regular
Also, if you haven't yet, run these commands - again, making the appropriate changes:
git config --global user.email "firstname.lastname@example.org" git config --global user.name "Your Name"Next
Protonmail does not support the open, industry-standard protocols necessary for git send-email to work out-of-the-box. To solve this, Protonmail offers Protonmail Bridge. Otherwise, you need to install & configure Hydroxide to connect to Protonmail with SMTP. Once you have configured Protonmail Bridge or Hydroxide, use its SMTP details along with the generic instructions below.
Protonmail bridge users: the bridge uses SSL authentication, but it self-signs the certificate used for SSL, so you will need to disable SSL verification with the daemon in your git config by setting an empty value for sendemail.smtpsslcertpath.
If you already have an SMTP client installed, you can configure
git send-email to use it by setting
to the path of its executable. For example, to use msmtp you
could add this to your global configuration file:
[sendemail] smtpserver = /usr/bin/msmtp
If you have multiple accounts configured for your SMTP client and want to specify one, you can use the
sendemail.smtpserveroption setting. For example, to choose an account named
work configured for msmtp:
[sendemail] smtpserver = /usr/bin/msmtp smtpserveroption = -a smtpserveroption = workNext
Your email provider should have instructions somewhere for SMTP access. Look these details up, and then add the following details from your mail provider:
[sendemail] smtpserver = mail.example.org smtpuser = email@example.com smtpencryption = ssl smtpserverport = 465
Be sure to fill in the appropriate values for your email
provider - you will probably only have to fill in
smtpuser. Also, if
you haven't yet, run these commands - again, making the
git config --global user.email "firstname.lastname@example.org" git config --global user.name "Your Name"Next
This configuration assumes direct TLS. If your provider only
offers STARTTLS, set
smtpencryption = tls and
smtpserverport = 587.