Skip to content

Instantly share code, notes, and snippets.

@nemolize
Last active May 19, 2022 14:40
Show Gist options
  • Save nemolize/59fbcd92bd6f45dbec8ba7fdda3e4ccf to your computer and use it in GitHub Desktop.
Save nemolize/59fbcd92bd6f45dbec8ba7fdda3e4ccf to your computer and use it in GitHub Desktop.
Sign your git commits with a key imported from keybase
# NOTE: Assuming you have already installed keybase and logged in
# This is only for WSL. see: https://github.com/microsoft/WSL/issues/4029
export GPG_TTY=$(tty)
# import your public/private keys from keybase
keybase pgp export | gpg --import
keybase pgp export --secret | gpg --allow-secret-key --import --batch
# show your imported keys
gpg --list-secret-keys
# set automatically sign your commit
git config --global user.signingkey <Your hash>
# type "trust" in gpg console. and type "5" or whatever you like. (this is needed to avoid warning in git log)
gpg --edit-key <Your hash>
git config --global gpg.program $(which gpg) # set signing program
git config --global commit.gpgsign true # enable signing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment