Git: Autosign commits

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
    
  2. Then, configure Git use the said key globally
     git config --global user.signingkey KEY_ID
    
  3. 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.
  4. 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.