Generating a new SSH key

  • Read this to learn how to generate a public/private key pair.

Adding the SSH key to your GitHub account

  • Profile > Settings > SSH and GPG keys > New SSH key
  • Enter a title of your choice and the public key.
  • Change key type to Signing key and click Add SSH key.

Configuring Git to sign commits by default

1
2
3
git config --global commit.gpgsign true
git config --global gpg.format ssh
git config --global user.signingkey <absolute_path_to_private_key>

References