- Generate key
gpg --gen-key #use the same name and email address as on Github
- 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)
- Save key
mkdir ~/.gpg
gpg --armor --export AAAABBBBCCCCDDDDEEEEFFFF > ~/.gpg/[email protected]
- Add to Github
https://github.com/settings/keys
- Set up Git
git config --global user.signingkey AAAABBBBCCCCDDDDEEEEFFFF git config --global commit.gpgsign true