Guide / Create the GPG keyStep 2 of 5
Create one GPG key with both emails
GitHub shows Verified when a commit is signed by a key that contains the commit's email. One GPG key can hold several emails, so a single key covers both accounts.
#Make the key
gpg --full-generate-key| It asks | You type |
|---|---|
| Kind of key | Enter (default) |
| Elliptic curve | Enter (default) |
| Key is valid for? | 0 (never expires) or 2y |
| Is this correct? | y |
| Real name | Your Name |
| Email address | your personal email |
| Comment | nothing, just press Enter |
| (N)ame, (C)omment, (E)mail or (O)kay | O |
| Passphrase | a strong one, and remember it |
Don't type your name or email again at Comment, it makes the key look messy. Don't use a huge expiry like
100y, gpg rejects it withinvalid value.
#Find your key ID
gpg --list-secret-keys --keyid-format=longsec ed25519/25B79846119AEE81 2026-10-19 [SC]
3439F5BC8FA34EB1C3EEE13525B79846119AEE81 <- this long line is your KEY_ID
uid [ultimate] Your Name <you@personal.dev>
ssb cv25519/E7B4E44FC1B55C24 2026-10-19 [E]#Add your work email
gpg --quick-add-uid <KEY_ID> "Your Name <you@company.com>"
gpg --check-trustdbThe second command refreshes gpg's local trust list. Without it the new email shows [ unknown] for a while. That is only cosmetic: signing and GitHub work either way.
Check that both emails are there:
gpg --list-keys <KEY_ID>uid [ultimate] Your Name <you@personal.dev>
uid [ultimate] Your Name <you@company.com>Added a wrong email? Remove it
gpg --edit-key <KEY_ID>
gpg> list # shows the emails with numbers
gpg> uid 2 # pick the wrong one
gpg> deluid
Really remove this user ID? (y/N) y
gpg> saveOnly do this before you upload the key anywhere.