Skip to content

Instantly share code, notes, and snippets.

@jerry80409
Forked from danieleggert/GPG and git on macOS.md
Created October 11, 2024 16:40
Show Gist options
  • Save jerry80409/9bdbdb6283c74cd54adb4497b1442c0f to your computer and use it in GitHub Desktop.
Save jerry80409/9bdbdb6283c74cd54adb4497b1442c0f to your computer and use it in GitHub Desktop.

Revisions

  1. @danieleggert danieleggert revised this gist May 2, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,10 @@ git config --global gpg.program /usr/local/MacGPG2/bin/gpg2
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    ```
    1. Optionally configure annotated tags to be GPG signed
    ```
    git config --global tag.forceSignAnnotated true
    ```
    1. Add this line to `~/.gnupg/gpg-agent.conf`
    ```
    pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
  2. @danieleggert danieleggert revised this gist Feb 15, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -2,14 +2,14 @@

    ## Setup

    No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
    *No need* for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

    1. Install https://gpgtools.org -- I'd suggest to do a **customized install** and deselect **GPGMail**.
    1. Create or import a key -- see below for https://keybase.io
    1. Run `gpg --list-secret-keys` and look for `sec`, use the key ID for the next step
    1. Configure `git` to use GPG -- replace the key with the one from `gpg --list-secret-keys`
    ```
    git config --global gpg.program `which gpg`
    git config --global gpg.program /usr/local/MacGPG2/bin/gpg2
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    ```
    @@ -36,7 +36,7 @@ no-tty

    ```
    % open https://github.com/settings/keys
    % keybase pgp export -q CB86A866E870EE00 | pbcopy
    % keybase pgp export -q CB86A866E440EE00 | pbcopy
    ```

    ## See Also
  3. @danieleggert danieleggert revised this gist Jul 14, 2016. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # Setup
    # GPG and git on macOS

    ## Setup

    No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

    @@ -20,7 +22,7 @@ pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pine
    no-tty
    ```

    # Keybase.io
    ## Keybase.io

    ### Import key to GPG on another host

    @@ -37,7 +39,7 @@ no-tty
    % keybase pgp export -q CB86A866E870EE00 | pbcopy
    ```

    # See Also
    ## See Also

    * https://github.com/pstadler/keybase-gpg-github
    * `/usr/local/MacGPG2` -- this is where MacGPG binaries live
  4. @danieleggert danieleggert revised this gist Jul 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ no-tty
    # See Also

    * https://github.com/pstadler/keybase-gpg-github
    * /usr/local/MacGPG2 -- this is where MacGPG binaries live
    * `/usr/local/MacGPG2` -- this is where MacGPG binaries live
    * https://gpgtools.org
    * https://www.git-tower.com

  5. @danieleggert danieleggert revised this gist Jul 4, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,9 @@ git config --global commit.gpgsign true
    pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
    ```
    1. Add this line to `~/.gnupg/gpg.conf`
    ```
    no-tty
    ```
    ```
    no-tty
    ```

    # Keybase.io

  6. @danieleggert danieleggert revised this gist Jul 4, 2016. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -6,15 +6,15 @@ No need for homebrew or anything like that. Works with https://www.git-tower.com
    1. Create or import a key -- see below for https://keybase.io
    1. Run `gpg --list-secret-keys` and look for `sec`, use the key ID for the next step
    1. Configure `git` to use GPG -- replace the key with the one from `gpg --list-secret-keys`
    ```
    git config --global gpg.program `which gpg`
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    ```
    ```
    git config --global gpg.program `which gpg`
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    ```
    1. Add this line to `~/.gnupg/gpg-agent.conf`
    ```
    pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
    ```
    ```
    pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
    ```
    1. Add this line to `~/.gnupg/gpg.conf`
    ```
    no-tty
  7. @danieleggert danieleggert revised this gist Jul 4, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -7,9 +7,9 @@ No need for homebrew or anything like that. Works with https://www.git-tower.com
    1. Run `gpg --list-secret-keys` and look for `sec`, use the key ID for the next step
    1. Configure `git` to use GPG -- replace the key with the one from `gpg --list-secret-keys`
    ```
    git config --global gpg.program `which gpg`
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    git config --global gpg.program `which gpg`
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    ```
    1. Add this line to `~/.gnupg/gpg-agent.conf`
    ```
  8. @danieleggert danieleggert revised this gist Jul 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

    1. Install https://gpgtools.org -- I'd suggest to do a **customized install** and deselect **GPGMail**.
    1. Create or import a key
    1. Create or import a key -- see below for https://keybase.io
    1. Run `gpg --list-secret-keys` and look for `sec`, use the key ID for the next step
    1. Configure `git` to use GPG -- replace the key with the one from `gpg --list-secret-keys`
    ```
  9. @danieleggert danieleggert revised this gist Jul 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

    1. Install https://gpgtools.org -- I'd suggest to do a *customized install* and deselect GPGMail.
    1. Install https://gpgtools.org -- I'd suggest to do a **customized install** and deselect **GPGMail**.
    1. Create or import a key
    1. Run `gpg --list-secret-keys` and look for `sec`, use the key ID for the next step
    1. Configure `git` to use GPG -- replace the key with the one from `gpg --list-secret-keys`
  10. @danieleggert danieleggert revised this gist Jul 4, 2016. No changes.
  11. @danieleggert danieleggert created this gist Jul 4, 2016.
    46 changes: 46 additions & 0 deletions GPG and git on macOS.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    # Setup

    No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

    1. Install https://gpgtools.org -- I'd suggest to do a *customized install* and deselect GPGMail.
    1. Create or import a key
    1. Run `gpg --list-secret-keys` and look for `sec`, use the key ID for the next step
    1. Configure `git` to use GPG -- replace the key with the one from `gpg --list-secret-keys`
    ```
    git config --global gpg.program `which gpg`
    git config --global user.signingkey A6B167E1
    git config --global commit.gpgsign true
    ```
    1. Add this line to `~/.gnupg/gpg-agent.conf`
    ```
    pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
    ```
    1. Add this line to `~/.gnupg/gpg.conf`
    ```
    no-tty
    ```

    # Keybase.io

    ### Import key to GPG on another host

    ```
    % keybase pgp export
    % keybase pgp export -q CB86A866E870EE00 | gpg --import
    % keybase pgp export -q CB86A866E870EE00 --secret | gpg --allow-secret-key-import --import
    ```

    ### Add public GPG key to GitHub

    ```
    % open https://github.com/settings/keys
    % keybase pgp export -q CB86A866E870EE00 | pbcopy
    ```

    # See Also

    * https://github.com/pstadler/keybase-gpg-github
    * /usr/local/MacGPG2 -- this is where MacGPG binaries live
    * https://gpgtools.org
    * https://www.git-tower.com