Skip to content

Instantly share code, notes, and snippets.

@ericboehs
Last active February 19, 2021 15:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ericboehs/c657fe5ac72fba5018457b14cb636813 to your computer and use it in GitHub Desktop.
Save ericboehs/c657fe5ac72fba5018457b14cb636813 to your computer and use it in GitHub Desktop.
Keybase.io + GitHub Verified Commits + macOS Keychain
# Install keybase and pinentry-mac
brew update
brew install keybase pinentry-mac
# Create a Keybase.io account and key
keybase signup
# Or if you have an account
keybase login
# Copy your key into gpg
keybase pgp export -s --unencrypted | gpg --allow-secret-key-import --import
# Edit your key to include your GitHub email
gpg --edit-key ericboehs adduid save
Eric Boehs
eric@boehs.com
O
# Update your Keybase key with your GitHub email
keybase pgp update
# Copy your Keybase key to GitHub
keybase pgp export | pbcopy
open https://github.com/settings/keys
# Configure pinentry-mac to save passphrase in Keychain
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
# Silence "you need a passphrase" on commit signing
echo "batch" >> ~/.gnupg/gpg.conf
# Configure singing key for Git
git config --global user.signingkey eric@boehs.com
# Configure gpg2 location
git config --global gpg.program gpg
# Always sign commits
git config --global commit.gpgsign true
# That's it! Go commit something and push it to GitHub. You should see a "Verified" badge next to the commit.
# Further resources:
# - https://www.ahmadnassri.com/blog/github-gpg-keybase-pgp/
# - http://www.keybits.net/2016/02/import-keybase-private-key/
# - https://gist.github.com/cc21ec0a3a2df963bffa3c1f884b676b
brew update && brew install keybase pinentry-mac
keybase login
keybase pgp export -s --unencrypted | gpg --allow-secret-key-import --import
gpg --edit-key ericboehs adduid save
Eric Boehs
eric@boehs.com
O
cd ~/.dotfiles && git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment