Created
February 24, 2021 15:01
-
-
Save tuxfight3r/c0022fa2a48f4b4c7ac4ad17f37642e5 to your computer and use it in GitHub Desktop.
signing git commits with GPG keys.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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