1. Configure git. ```gitconfig # ~/.config/git/config [sendemail] confirm = auto smtpServer = smtp.gmail.com smtpServerPort = 587 smtpEncryption = tls smtpUser = ``` 2. Configure Authentication. I believe the simplest setup is to [create an application-specific password](https://security.google.com/settings/security/apppasswords) in Google dedicated to git. ``` Google Account -> Security -> Signing in to Google : App passwords ``` This password must be configured in git, but should be kept outside of your main gitconfig (which is likely versioned via a dotfile repo?). To do that, I use git's `[include]` directive. ```gitconfig # ~/.config/git/config [include] path = config.local # (relative or absolute path to the other config file) ``` ```gitconfig # ~/.config/git/config.local [sendemail] smtpPass = ``` Alternatively, check out https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail which supports authenticating to GMail with OAuth2. 3. Determine your revlist. To send a single commit, just use the sha. To send a range of commits, you can use `start_sha..end_sha`. Most likely, you'll want to send the commits made to a branch that are missing in upstream. For that, you would use: `upstream/branch_name..branch_name` You can also use relative numbers to indicate the "previous X commits". e.g. `git send-email -3` 4. Send email: ``` git send-email --to ``` 5. If you receive an error like this: ``` Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: ... ``` You may need to upgrade/install the Net::SMTP::SSL or IO::Socket::SSL packages: ```sh sudo -H cpan Net::SMTP::SSL sudo -H cpan IO::Socket::SSL ``` 6. Advanced: configure multiple identites. You may configure multiple smtp servers and switch between them with [identities](https://git-scm.com/docs/git-config#Documentation/git-config.txt-sendemailidentity). ```gitconfig [sendemail "gmail"] smtpUser = jason@gmail.com smtpServer = smtp.gmail.com [sendemail "outlook"] smtpUser = jason@outlook.com smtpServer = smtp.office365.com [sendemail] identity = outlook ```