Skip to content

Instantly share code, notes, and snippets.

@cppshane
Created May 10, 2022 23:12
Show Gist options
  • Save cppshane/a26dde07705221f6657faa20a0285a29 to your computer and use it in GitHub Desktop.
Save cppshane/a26dde07705221f6657faa20a0285a29 to your computer and use it in GitHub Desktop.
Git GPG Setup
# Generate key and list them
# Sample Output:
# /home/shane/.gnupg/pubring.kbx
# ------------------------------
# sec rsa3072/12345ABCDE 2021-11-12 [SC] [expires: 2023-11-12]
# 123456789
# uid [ultimate] Shane Duffy <shane@shaneduffy.io>
# ssb rsa3072/12345ZZZZZ 2021-11-12 [E] [expires: 2023-11-12]
gpg --gen-key
gpg --list-secret-keys --keyid-format LONG
# Export key to file, add result to GitHub
gpg --armor --export 12345ABCDE gpg-key.txt
# Set as signing key
git config --global user.signingkey 12345ABCDE
git config --global commit.gpgsign true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment