gpg --gen-key
gpg --list-secret-keys --keyid-format LONG
Public key can be added to GitHub for Verified commits.
/home/username/.gnupg/pubring.gpg
---------------------------------
sec rsa2048/KKKKKKKKKKKKKKKK 2017-12-16 [SC]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
uid [ xxxxxxx] Your Name <your-email@example.com>
ssb rsa2048/XXXXXXXXXXXXXXXX 2017-12-16 [E]
KKKKKKKKKKKKKKKK
is your secret key.
gpg --armor --export secret-key
# Global use
git config --global user.signingkey secret-key
# Repository use
git config user.signingkey secret-key
git commit -S -m "Commit message"
git config --global commit.gpgsign true
git log -4 --show-signature
Some one's public GPG Key.
gpg --import gpg-public-key.gpg
gpg --output new-encrypted-file.doc --encrypt --recipient recipient-email@example.com
gpg --output new-decrypted-file.doc --decrypt encrypted-file.doc
echo "test" | gpg --clearsign
gpg: signing failed: Inappropriate ioctl for device
export GPG_TTY=$(tty)
brew install gpg2 gnupg pinentry-mac