Add Signing Key to GitHub
This guide walks through adding your SSH signing key to GitHub so your commits show as "Verified."
Prerequisites
- A GitHub account
- Git configured for commit signing (see Git Commit Signing)
1. Copy Your Public Key
- Windows
- macOS
- Linux
# Copy to clipboard
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard
# Or display to copy manually
Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub
# Copy to clipboard
pbcopy < ~/.ssh/id_ed25519.pub
# Or display to copy manually
cat ~/.ssh/id_ed25519.pub
# Copy to clipboard (requires xclip)
xclip -selection clipboard < ~/.ssh/id_ed25519.pub
# Or display to copy manually
cat ~/.ssh/id_ed25519.pub
2. Add to GitHub
- Go to github.com/settings/keys
- Click New SSH key
- In the Title field, add a descriptive label (e.g., "Signing Key - Work Laptop")
- For Key type, select Signing Key
- In the Key field, paste your public key
- Click Add SSH key
tip
You can use the same SSH key for both authentication and signing, but you need to add it twice - once as an "Authentication Key" and once as a "Signing Key."
3. Verify It's Working
- Make a signed commit:
- Windows
- macOS
- Linux
Add-Content test.txt "test"
git add test.txt
git commit -m "Test signed commit"
git push
echo "test" >> test.txt
git add test.txt
git commit -m "Test signed commit"
git push
echo "test" >> test.txt
git add test.txt
git commit -m "Test signed commit"
git push
- View the commit on GitHub - it should show a green Verified badge
Troubleshooting
Commits Show "Unverified"
-
Email mismatch: The email in your Git config must match an email on your GitHub account
git config --get user.email -
Key not added as signing key: Ensure you added the key with type "Signing Key" (not just "Authentication Key")
-
Wrong key being used: Verify Git is using the correct key
git config --get user.signingkey
Related
- Git Commit Signing - Configure Git for signing
- Add SSH Key to GitHub - For authentication
- GitHub Signature Verification