Skip to content

Instantly share code, notes, and snippets.

@bensenq
Forked from jasonkarns/readme.md
Created April 26, 2025 12:54
Show Gist options
  • Save bensenq/6f4665af40e84a1c17649f99c8be07ab to your computer and use it in GitHub Desktop.
Save bensenq/6f4665af40e84a1c17649f99c8be07ab to your computer and use it in GitHub Desktop.

Revisions

  1. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -54,8 +54,6 @@ 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).

    e.g.
    ```gitconfig
    [sendemail "gmail"]
    smtpUser = [email protected]
  2. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,7 @@ This password must be configured in git, but should be kept outside of your main
    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`

  3. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,8 @@ This password must be configured in git, but should be kept outside of your main

    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`
    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:
  4. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ This password must be configured in git, but should be kept outside of your main
    ```gitconfig
    # ~/.config/git/config.local
    [sendemail]
    smtpPass = <app-specific-password from step 2>
    smtpPass = <app-specific-password>
    ```

    Alternatively, check out https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail which supports authenticating to GMail with OAuth2.
  5. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,7 @@ This password must be configured in git, but should be kept outside of your main
    # ~/.config/git/config
    [include]
    path = config.local # (relative or absolute path to the other config file)
    ```

    ```gitconfig
    # ~/.config/git/config.local
  6. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 3 changed files with 21 additions and 15 deletions.
    10 changes: 0 additions & 10 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -1,10 +0,0 @@
    # ~/.config/git/config
    [sendemail]
    confirm = auto
    smtpServer = smtp.gmail.com
    smtpServerPort = 587
    smtpEncryption = tls
    smtpUser = <gmail email address>

    [include]
    path = /path/to/other # (I use `config.local` which lives next to `~/.config/git/config`)
    3 changes: 0 additions & 3 deletions .gitconfig.local
    Original file line number Diff line number Diff line change
    @@ -1,3 +0,0 @@
    # ~/.config/git/config.local
    [sendemail]
    smtpPass = <app-specific-password from step 2>
    23 changes: 21 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,13 @@
    1. Configure git.
    see [gitconfig](#file-gitconfig)
    ```gitconfig
    # ~/.config/git/config
    [sendemail]
    confirm = auto
    smtpServer = smtp.gmail.com
    smtpServerPort = 587
    smtpEncryption = tls
    smtpUser = <gmail email address>
    ```

    2. Configure Authentication.

    @@ -8,7 +16,18 @@ I believe the simplest setup is to [create an application-specific password](htt
    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. see [#gitconfig.local](#file-gitconfig-local)
    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 = <app-specific-password from step 2>
    ```

    Alternatively, check out https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail which supports authenticating to GMail with OAuth2.

  7. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -36,11 +36,11 @@ You may configure multiple smtp servers and switch between them with [identities
    e.g.
    ```gitconfig
    [sendemail "gmail"]
    smtpUser = [email protected]
    smtpUser = [email protected]
    smtpServer = smtp.gmail.com

    [sendemail "outlook"]
    smtpUser = [email protected]
    smtpUser = [email protected]
    smtpServer = smtp.office365.com

    [sendemail]
  8. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 18 additions and 1 deletion.
    19 changes: 18 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,24 @@ git send-email <revlist> --to <[email protected]>
    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).

    e.g.
    ```gitconfig
    [sendemail "gmail"]
    smtpUser = [email protected]
    smtpServer = smtp.gmail.com

    [sendemail "outlook"]
    smtpUser = [email protected]
    smtpServer = smtp.office365.com

    [sendemail]
    identity = outlook
    ```
  9. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,7 @@ I believe the simplest setup is to [create an application-specific password](htt
    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.

    see [#gitconfig.local](#file-gitconfig.local)
    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. see [#gitconfig.local](#file-gitconfig-local)

    Alternatively, check out https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail which supports authenticating to GMail with OAuth2.

  10. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 3 changed files with 8 additions and 12 deletions.
    3 changes: 3 additions & 0 deletions gitconfig → .gitconfig
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,6 @@
    smtpServerPort = 587
    smtpEncryption = tls
    smtpUser = <gmail email address>

    [include]
    path = /path/to/other # (I use `config.local` which lives next to `~/.config/git/config`)
    3 changes: 3 additions & 0 deletions .gitconfig.local
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # ~/.config/git/config.local
    [sendemail]
    smtpPass = <app-specific-password from step 2>
    14 changes: 2 additions & 12 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -8,19 +8,9 @@ I believe the simplest setup is to [create an application-specific password](htt
    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?).
    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.

    ```
    # ~/.config/git/config
    [include]
    path = config.local
    ```

    ```
    # ~/.config/git/config.local
    [sendemail]
    smtpPass = <app-specific-password>
    ```
    see [#gitconfig.local](#file-gitconfig.local)

    Alternatively, check out https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail which supports authenticating to GMail with OAuth2.

  11. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    1. Configure git.

    see [gitconfig](#gitconfig)
    see [gitconfig](#file-gitconfig)

    2. Configure Authentication.

  12. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    1. Configure git.

    see [gitconfig][#gitconfig]
    see [gitconfig](#gitconfig)

    2. Configure Authentication.

  13. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 2 changed files with 9 additions and 9 deletions.
    7 changes: 7 additions & 0 deletions gitconfig
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # ~/.config/git/config
    [sendemail]
    confirm = auto
    smtpServer = smtp.gmail.com
    smtpServerPort = 587
    smtpEncryption = tls
    smtpUser = <gmail email address>
    11 changes: 2 additions & 9 deletions gistfile1.md → readme.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,6 @@
    1. Configure git.
    ```
    # ~/.config/git/config
    [sendemail]
    confirm = auto
    smtpServer = smtp.gmail.com
    smtpServerPort = 587
    smtpEncryption = tls
    smtpUser = <gmail email address>
    ```

    see [gitconfig][#gitconfig]

    2. Configure Authentication.

  14. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 21 additions and 4 deletions.
    25 changes: 21 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    1. Configure Gmail in your gitconfig:
    1. Configure git.
    ```
    # ~/.config/git/config
    [sendemail]
    confirm = auto
    smtpServer = smtp.gmail.com
    @@ -8,12 +9,28 @@
    smtpUser = <gmail email address>
    ```

    2. I recommend setting up an application-specific password in Google dedicated to git.
    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?).

    ```
    Account -> Security -> Connected applications and sites : Manage Access
    # ~/.config/git/config
    [include]
    path = config.local
    ```

    ```
    # ~/.config/git/config.local
    [sendemail]
    smtpPass = <app-specific-password>
    ```

    https://security.google.com/settings/security/apppasswords
    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`
  15. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    1. Configure Gmail in you gitconfig:
    1. Configure Gmail in your gitconfig:
    ```
    [sendemail]
    confirm = auto
    @@ -13,7 +13,10 @@
    Account -> Security -> Connected applications and sites : Manage Access
    ```

    https://security.google.com/settings/security/apppasswords

    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:
    ```
    @@ -29,4 +32,3 @@ You may need to upgrade/install the Net::SMTP::SSL or IO::Socket::SSL packages:
    sudo -H cpan Net::SMTP::SSL
    sudo -H cpan IO::Socket::SSL
    ```

  16. @jasonkarns jasonkarns revised this gist Feb 20, 2020. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    1. Configure Gmail in you gitconfig:
    ```
    [sendemail]
    smtpserver = smtp.gmail.com
    smtpserverport = 587
    smtpencryption = tls
    smtpuser = <gmail email address>
    from = <email address for From: field>
    confirm = auto
    smtpServer = smtp.gmail.com
    smtpServerPort = 587
    smtpEncryption = tls
    smtpUser = <gmail email address>
    ```

    2. I recommend setting up an application-specific password in Google dedicated to git.
  17. @dayyan dayyan revised this gist May 6, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,9 @@ git send-email <revlist> --to <[email protected]>
    ```
    Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: ...
    ```
    you'll need to upgrade/install the Net::SMTP::SSL package:
    You may need to upgrade/install the Net::SMTP::SSL or IO::Socket::SSL packages:
    ```
    sudo -H cpan Net::SMTP::SSL
    ```
    sudo -H cpan IO::Socket::SSL
    ```

  18. @jasonkarns jasonkarns revised this gist Dec 21, 2012. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,21 +8,23 @@
    from = <email address for From: field>
    ```

    I also recommend setting up an application-specific password in Google for this. `Account -> Security -> Connected applications and sites : Manage Access`
    2. I recommend setting up an application-specific password in Google dedicated to git.
    ```
    Account -> Security -> Connected applications and sites : Manage Access
    ```

    2. 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`
    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`

    3. Send email:
    4. Send email:
    ```
    git send-email <revlist> --to <[email protected]>
    ```

    4. If you receive an error like this:
    5. If you receive an error like this:
    ```
    Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: ...
    ```
    you'll need to upgrade/install the Net::SMTP::SSL package:
    ```
    sudo -H cpan Net::SMTP::SSL
    ```

    ```
  19. @jasonkarns jasonkarns revised this gist Dec 21, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@
    from = <email address for From: field>
    ```

    I also recommend setting up an application-specific password in Google for this. `Account -> Security -> Connected applications and sites : Manage Access`

    2. 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`

    3. Send email:
  20. @jasonkarns jasonkarns revised this gist Dec 21, 2012. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -10,12 +10,17 @@

    2. 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`

    3. Send email: `git send-email <revlist> --to <[email protected]>`
    3. Send email:
    ```
    git send-email <revlist> --to <[email protected]>
    ```

    4. If you receive an error like this:
    ```
    Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: ...
    ```
    you'll need to upgrade/install the Net::SMTP::SSL package:
    `sudo -H cpan Net::SMTP::SSL`
    ```
    sudo -H cpan Net::SMTP::SSL
    ```

  21. @jasonkarns jasonkarns revised this gist Dec 21, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@

    2. 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`

    3. Send email: `git send-email <revlist> --to <[email protected]>
    3. Send email: `git send-email <revlist> --to <[email protected]>`

    4. If you receive an error like this:
    ```
  22. @jasonkarns jasonkarns renamed this gist Dec 21, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  23. @jasonkarns jasonkarns created this gist Dec 21, 2012.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    1. Configure Gmail in you gitconfig:
    ```
    [sendemail]
    smtpserver = smtp.gmail.com
    smtpserverport = 587
    smtpencryption = tls
    smtpuser = <gmail email address>
    from = <email address for From: field>
    ```

    2. 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`

    3. Send email: `git send-email <revlist> --to <[email protected]>

    4. If you receive an error like this:
    ```
    Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: ...
    ```
    you'll need to upgrade/install the Net::SMTP::SSL package:
    `sudo -H cpan Net::SMTP::SSL`