GPG-Note

Import/export key

gpg --list-keys
gpg --armor --output <public-key-file> --export <ID>
gpg --import <public-key-file>
gpg --keyserver hkp://keys.gnupg.net --search-keys <ID>
gpg --armor --output <private-key-file> --export-secret-keys <ID>
gpg --allow-secret-key-import --import <private-key-file>
gpg --list-secret-keys --keyid-format LONG

Edit passphrase

gpg --edit-key <ID>
passwd

Git setup gpg sign

Github add gpg public key

git config --global commit.gpgsign true
git config --global gpg.program gpg

gpg and git for MAC

# import keys
gpg2 --list-secret-keys
git config --global gpg.program /usr/local/bin/gpg2
git config --global user.signingkey 987BACA4 
git config --global commit.gpgsign true 

Refer gists

Last updated