Skip to content

Instantly share code, notes, and snippets.

@abiiranathan
Last active March 9, 2023 18:03
Show Gist options
  • Save abiiranathan/5065dfc7bac0b1f28c49e0d7653959fc to your computer and use it in GitHub Desktop.
Save abiiranathan/5065dfc7bac0b1f28c49e0d7653959fc to your computer and use it in GitHub Desktop.
Generate GPG Keys for Github to securely sign your commits.
#!/bin/bash
gpg --full-generate-key
key_id=$(gpg --list-secret-keys --keyid-format=long | grep sec | awk '{print $2}' | awk -F '/' '{print $2}')
echo "Key ID: $key_id"
gpgKey=$(gpg --armor --export $key_id)
echo $gpgKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment