1. generate key
ssh-keygen -t ed25519 -C "your@email.com"
cat ~/.ssh/id_ed25519.pub
cat ~/.ssh/id_ed25519.pub | xclip -sel c
  1. copy key to github - https://github.com/settings/keys

  2. add authentication keys and signing keys

  3. Testing your SSH connection

ssh -T git@github.com
  1. signing your commits
git config --global gpg.format ssh
git config --global user.signingkey /PATH/TO/.SSH/KEY.PUB

make sure email id in ~/.gitconfig matches with your github account

git add index.html; git commit -S -m  'signed commit with correct email'

extra reading