Skip to content

Instantly share code, notes, and snippets.

@emir-munoz
Last active February 28, 2018 22:44
Show Gist options
  • Save emir-munoz/681381b7f236657314cd8451074b446f to your computer and use it in GitHub Desktop.
Save emir-munoz/681381b7f236657314cd8451074b446f to your computer and use it in GitHub Desktop.
How to add a GPG key to verify your commits in GitHub
$ gpg2 --full-gen-key

List available keys

$ gpg2 --list-keys --keyid-format LONG

Obtain a GPG key

$ gpg2 --armor --export ABC123DEF

Add the obtained key to your account.

Activate the signing of git commits (globally) with the obtained key

$ git config --global commit.gpgsign true
$ git config --global gpg.program gpg2
$ git config --global user.signingkey ABC123DEF

Note: ensure that the commiters' email march the email in the key. Set the email if needed

$ git config user.email email@domain.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment