Skip to content

Instantly share code, notes, and snippets.

@therealbenpai
Created January 3, 2023 17:06
Show Gist options
  • Save therealbenpai/587a9b46e0f09738492015f9ff9cbc45 to your computer and use it in GitHub Desktop.
Save therealbenpai/587a9b46e0f09738492015f9ff9cbc45 to your computer and use it in GitHub Desktop.
Generating PGP Keys

How to generate a PGP Key for usage in GitHub

Needed programs:

Steps on making a PGP key:

  1. Install GPG on your machine
  2. Run the following command substituting the any values: gpg --quick-generate-key "Name_Here <Email_Address>" rsa4096 cert,sign,auth,encr never
  3. In Git Bash, run gpg -k and make sure the key is there.
  4. Run gpg -a --export Name_Here and copy the value
  5. Goto the GitHub Keys settings and paste it as a new PGP key
  6. Get your PGP ID (that is the last 16 charactors of your key's fingerprint. If my fingerprint was 384983B33A4FE64410E065CECF72C4A1E58FCC7B, the ID would be CF72 C4A1 E58F CC7B from 384983B33A4FE64410E065CECF72C4A1E58FCC7B
  7. Run the following commands:
git config --global user.signingkey <KEY_ID>
git config --global user.email <EMAIL>
git config --global commit.gpgsign true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment