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.
Add these details to your global configuration file:
[sendemail] smtpserver = smtp.gmail.com smtpuser = email@example.com smtpencryption = tls smtpserverport = 587
Be sure to fill in your own email address under
smtpuser. You also need to obtain an
application-specific password for git from the app passwords page on your Google account. To store this
password with git, run this command:
git config --global sendemail.smtpPass 'your password'
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.Next
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 = tls smtpserverport = 587
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