How to sign git commits

2026-10-19

  1. Generate SSH Key (though existing one can be used also)
ssh-keygen -t ed25519 -C "1190812+alexgalkin@users.noreply.github.com" -f ~/.ssh/github_signing_key
  1. View and copy the full public key and add it to your Github profile as a Signing key
cat ~/.ssh/github_signing_key.pub
  1. Configure your new key for signing using git
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/github_signing_key.pub
  1. And when you do commits use -S parameter
git commit -S -m "fix: resolved the issue with keys signing"

Useful references: