- Install Keybase and login
$ brew cask install keybase
$ keybase login
- Create a new GPG key on keybase
$ keybase pgp gen --multi
- Follow instructions
- Note: the email used in the key must match the user email in your
~/.gitconfig
- Set up Git to sign all commits
$ gpg --list-secret-keys
$ git config --global user.signingkey sec
$ git config --global commit.gpgsign true
- Add public GPG key to GitHub
- Go to https://github.com/settings/keys
$ keybase pgp export -q ID | pbcopy
- New GPG Key > paste > save
- Import key to GPG on another host
$ keybase pgp export -q ID | gpg --import
$ keybase pgp export -q ID --secret | gpg --allow-secret-key-import --import
- Set as default GPG key
- vim ~/.gnupg/gpg.conf
- Add line: default-key sec
- Optional: Fix for Git UIs
- If you use a UI such as Git Tower or Github Desktop, you may need to configure git to point to the specific gpg executable:
git config --global gpg.program $(which gpg)
- Optional: Disable TTY
- If you have problems with making autosigned commits from IDE or other software add no-tty config
- vim ~/.gnupg/gpg.conf
- Add line: no-tty
- Optional: Setting up TTY
- Depending on your personal setup, you might need to define the tty for gpg whenever your passphrase is prompted. Otherwise, you might encounter an
Inappropriate ioctl for device
error. - vim ~/.profile (or other file that is sourced every time)
- Paste: GPG_TTY=$(tty) export GPG_TTY
- Depending on your personal setup, you might need to define the tty for gpg whenever your passphrase is prompted. Otherwise, you might encounter an
- Optional: Don't ask for password every time
$ brew install gpg-agent pinentry-mac
- vim ~/.gnupg/gpg-agent.conf
- Paste: use-standard-socket pinentry-program /usr/local/bin/pinentry-mac
- Commit and sign away!
- git commit -S -m “Great atomic code”
Created
February 21, 2017 20:08
-
-
Save atelic/efdf82e027733d71a356a3aeacd3d67e to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment