How to sign git commits with SSH keys

To sign git commits globally across every repository using your SSH key, set:

git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519
git config --global commit.gpgsign true

To do the same per repo, omit the --global flag.

Closing thoughts

I welcome your feedback and hearing about your experiences! If this post has been useful to you, please feel free to leave a comment down below.

References