Signing commits in git

gpg --list-secret-keys --keyid-format LONG

From the list of GPG keys, copy the GPG key ID you’d like to use. In this example, the GPG key ID isĀ 3AA5C34371567BD2

$ gpg --list-secret-keys --keyid-format LONG
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid                          Hubot 
ssb   4096R/42B317FD4BA89E7A 2016-03-10
git config --global user.signingkey 3AA5C34371567BD2

or

git commit -S -m your commit message

References
https://help.github.com/en/articles/telling-git-about-your-signing-key
https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work
https://help.github.com/en/articles/signing-commits

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.