Skip to content

Instantly share code, notes, and snippets.

@winksaville
Created March 20, 2018 18:25
Show Gist options
  • Save winksaville/dd69a860d0d05298d1945ceff048ce46 to your computer and use it in GitHub Desktop.
Save winksaville/dd69a860d0d05298d1945ceff048ce46 to your computer and use it in GitHub Desktop.
Setup git send-email using git credentials

Setup git send-email: following these instructions I had some problems. But the following worked:

  • I’m using 2-factor auth on my gmail account so I had to get a “app-password”, see google documentation

  • Modify the global/local .gitconfig file with a sendemail section: [sendemail] smtpEncryption = tls smtpServer = smtp.gmail.com smtpUser = wink@saville.com smtpServerPort = 587

  • Also add a credential section with a helper.store entry: [credential] helper = store

    The default file will be .git-credentials but you can specify a different file using --file [credential] helper = store --file /home/wink/.gitcreds

  • Now you can store your details in the “credentials” file (.git-credentials or .gitcreds in this case) with the “git credential-store store” command. Or you can just use git send-email and it will prompt for a password the first time it’s used.

    If you want to store the password explicitly then issue git credential-store command. That command accepts the information from stdin and stores the information after entering a blank line: $ git credential-store store protocol=smtp host=smtp.gmail.com:587 username=wink@saville.com password=

    $

@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented Jul 3, 2021

@edgesider
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment