How to Sign Your Commit on Github with SSH key
1. Tell Git to Use SSH for SigningOpen your terminal and configure Git to use SSH as your signature format:
git config --global gpg.format ssh
- Find your public SSH key
~/.ssh/id_ed25519.pubor~/.ssh/id_rsa.pub) and set it as your signing key:
git config --global user.signingkey "~/.ssh/id_ed25519.pub"
3. Enable Automatic Signing
git config --global commit.gpgsign true
4. Add Your Key to GitHub
- Copy your public SSH key content to your clipboard.
- Go to your GitHub SSH and GPG keys settings.
- Click New SSH Key.
- Set the Key type dropdown menu to Signing Key (do not leave it as Authentication Key).
- Paste your public key into the field and save it.