Skip to content

Instantly share code, notes, and snippets.

@g105b
Created June 17, 2019 19:49
Show Gist options
  • Save g105b/42bcf1c1b46d70f56a7678a5c8b40c99 to your computer and use it in GitHub Desktop.
Save g105b/42bcf1c1b46d70f56a7678a5c8b40c99 to your computer and use it in GitHub Desktop.
Use GPG to sign commits in PhpStorm on Ubuntu
  1. Generate key
gpg --gen-key #use the same name and email address as on Github
  1. Output key(s)
gpg --list-secret-keys --keyid-format LONG

Example output:

------------------------------
sec   rsa3072/AAAABBBBCCCCDDDDEEEEFFFF 2019-06-17 [SC] [expires: 2021-06-16]
      ABCDEF0123456ABCDEF0123456ABCDEF0123456ABCDEF0123456
uid                 [ultimate] Your Name <[email protected]>
ssb   rsa3072/FFFFEEEEDDDDCCCCBBBBAAAA 2019-06-17 [E] [expires: 2021-06-16]

Copy the "sec" rsa long key (AAAABBBB...FFFF)

  1. Save key
mkdir ~/.gpg
gpg --armor --export AAAABBBBCCCCDDDDEEEEFFFF > ~/.gpg/[email protected]
  1. Add to Github

https://github.com/settings/keys

  1. Set up Git

git config --global user.signingkey AAAABBBBCCCCDDDDEEEEFFFF git config --global commit.gpgsign true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment