gpg --gen-key
gpg --list-keys
git config --global commit.gpgsign true
gpg --list-keys
git config --global user.signingkey KEY_ID_HERE
gpg --armor --output beyarz.asc --export [email protected]
gpg --armor --export [email protected]
killall gpg-agent
gpg-agent --daemon
touch signed.txt
git add .
git commit -m "Testing to signed commit"
git push
Having to sign every commit is exhausting, GPG Keychain solves that by signing it for you. https://gpgtools.org
Download pinentry afterwards
brew install pinentry-mac
Add the following to ~/.gnupg/gpg-agent.conf
# Connects gpg-agent to the OSX keychain via the brew-installed
# pinentry program from GPGtools.
pinentry-program /usr/local/bin/pinentry-mac
gpg --list-keys
gpg --edit-key ID
gpg> passwd
gpg> save
Github - https://help.github.com/articles/adding-a-new-gpg-key-to-your-github-account/
Gitlab - https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/
Bitbucket - https://confluence.atlassian.com/bitbucketserver/using-gpg-keys-913477014.html#UsingGPGkeys-AddaGPGkeytoBitbucketServer