Adfaft

REF:

Add GPG into BASH
echo 'export GPG_TTY=$(tty)' >> ~/.zshrc && source ~/.zshrc
Backup GPG Key
gpg --armor --output gpg_sec_key.gpg --export XXXXXXXXXXX
gpg --armor --output gpg_sec_key.gpg --export-secret-keys XXXXXXXXXXX
Allow GIT to SIGN
git config --global gpg.format openpgp
git config --global user.signingkey XXXXXXXXXXXXX

git config --global commit.gpgsign true
git config --global tag.gpgsign true
Signed commit
# If your git and gpg key email addresses are different this will fail until
# you configure your git signingkey (covered on video).
git commit -S -m "Signed commit"
git log --show-signature
Unsigned tag
git tag lightweight-tag
git show lightweight-tag

git tag -am "" unsigned-annotated-tag
git show unsigned-annotated-tag
Signed tag
git tag -sm "" signed-tag
git show signed-tag
Overriding the auto-sign config options
git commit --no-gpg-sign -m "Unsigned commit"
git tag --no-sign unsigned-lightweight-tag
Verifying signatures when merging a branch with git
# It's expected that you already modified your .gitconfig to auto-sign commits.
git checkout -b feaure-something
touch somefile && git add -A && git commit -m "Hello world"
git checkout master
git merge --verify-signatures feature-something