Git: Autosign commits

9th September 2020

After generating a GPG key and adding it to your Github account, automatically signing your commits is very straightforward.

  1. First, find your key ID via
gpg --list-secret-keys --keyid-format LONG
  1. Then, configure Git use the said key globally
git config --global user.signingkey KEY_ID
  1. Check that user.email matches the one in your GPG key, and to be nice, user.name matches your Github username in git config --global --list.
  2. Finally, tell Git to sign all commits with the above credentials
git config --global commit.gpgsign true

Following the above, all of your commits should show a nice Verified badge next to them.