Skip to content

Instantly share code, notes, and snippets.

@erinishimoticha
Last active March 7, 2020 23:59
Show Gist options
  • Save erinishimoticha/a290f4cff8c5391ea9067bf715521032 to your computer and use it in GitHub Desktop.
Save erinishimoticha/a290f4cff8c5391ea9067bf715521032 to your computer and use it in GitHub Desktop.
Sign git commits with your Keybase gpg key

Install dependencies

brew install gpg
brew cask install keybase

Log into Keybase

keybase login $USERNAME

Set up your GPG key

If you have already created a GPG key in Keybase

Import your existing GPG key

keybase pgp export | gpg --import

If you do not ave a GPG key in Keybase yet

Create a GPG key.

keybase pgp gen --multi

Validate your GPG setup

gpg --list-secret-keys --keyid-format LONG

Configure git for relevant repos

cd $REPOSITORY
git config user.signingkey $KEY_ID
git config commit.gpgsign true

Add public key to github

Visit your GitHub keys settings page.

Copy your public key to your clipboard

keybase pgp export -q $KEY_ID | pbcopy

Click "New GPG Key" and paste it into the page.

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