🔀 Git: Fix a Commit Signature Failing After a Key Expiry Rotation
A GPG signing key with an expiration date eventually expires, and rotating to a new key means updating user.signingkey and uploading the new public key to GitHub or GitLab — but platforms re-validate signatures against key validity at view time, not just at commit time, so older commits signed with the now-expired key can suddenly show as “Unverified” retroactively, and a repo-local config override from before the rotation can keep referencing the expired key even after the global config looks correctly updated.
🔎 The Problem
$ git config --global user.signingkey NEWKEY123 # updated globally $ git -C old-project config user.signingkey OLDKEY456 # repo-local override, stale $ git -C old-project commit -S -m "fix" # silently signs with OLDKEY456 (expired) - shows as unverified on push
✅ Fix: Update Every Scope and Re-Upload the New Public Key Everywhere
- After rotating to a new signing key, explicitly update
user.signingkeyin both global and any repo-local git config, since a repo-local override from an old setup can silently keep using the expired key even after the global config looks correct. - Re-export and re-upload the new public key to every platform immediately, because a locally-valid new signature still shows as unverified on the server until the server has the new public key to check it against.
- Expect a previously-“Verified” commit signed with the expired key to permanently show as unverified after the fact — this is by platform design, not a sign anything about the repository changed, so don’t try to re-sign history that’s already been pushed and shared.
🚨 Why This Is Dangerous
- A contributor who doesn’t notice their new commits are silently landing unsigned, because the old expired key is still referenced somewhere in config, can lose a project’s “all commits verified” guarantee for an entire stretch of history without any error ever appearing locally.
A signing key rotation isn’t done when the global config looks right — it’s done when every repo-local override agrees with it too.




