Skip to content

Instantly share code, notes, and snippets.

@tuxfight3r
Created February 24, 2021 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tuxfight3r/c0022fa2a48f4b4c7ac4ad17f37642e5 to your computer and use it in GitHub Desktop.
Save tuxfight3r/c0022fa2a48f4b4c7ac4ad17f37642e5 to your computer and use it in GitHub Desktop.
signing git commits with GPG keys.
# generate a key if you don't have one already
gpg --full-gen-key
# list the keys in long format and copy the key id after sec rsa4096/<KEY>
gpg --list-secret-keys --keyid-format LONG
# export the public key and post into your git profile (ui)
gpg --armor --export 127CAA89CEA6BE66
# update the global git configs,
git config --global user.signingkey 127CAA89CEA6BE66
git config --global commit.gpgsign true
# update your GPG_TTY
echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile
#do a git commit and it should prompt you for your gpg password.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment