Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio
Git

Git: Fix a Commit Signature Failing After a Key Expiry Rotation

- 25.11.26 - ErcanOPAK

🔀 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.signingkey in 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.

— Version Control Tip

Related posts:

Git: Fix a Stale Remote Branch That Still Shows Up After It Was Deleted Because fetch Never Pruned I...

Git: Fix a Stale Remote Branch That Still Shows Up After It Was Deleted Because fetch Never Pruned I...

Git: Fix Nested Submodules That Stay Completely Empty Because Update Was Never Run With the Recursiv...

Git: Fix Nested Submodules That Stay Completely Empty Because Update Was Never Run With the Recursiv...

Git: Fix a Partial Clone That Fails to Check Out Files Because a Promisor Remote Went Offline

Git: Fix a Partial Clone That Fails to Check Out Files Because a Promisor Remote Went Offline

Views: 10
Found this useful? Share it
XLinkedInWhatsApp

Post navigation

The AI Prompt That Turns a Dependency Tree Into an Upgrade Order
Kubernetes: Fix a NetworkPolicy Silently Blocking DNS Egress

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Read

  1. 01How to make theater mode the default for Youtube 1,080 views
  2. 02How to add default value for Entity Framework migrations for DateTime and Bool 999 views
  3. 03Get the User Name and Domain Name from an Email Address in SQL 998 views
  4. 04Get the First and Last Word from a String or Sentence in SQL 874 views
  5. 05How to select distinct rows in a datatable in C# 869 views
  6. 06How to enable, disable and check if Service Broker is enabled on a database in SQL Server 673 views
  7. 07Add Constraint to SQL Table to ensure email contains @ 632 views
  8. 08Average of all values in a column that are not zero in SQL 586 views
  9. 09How to use Map Mode for Vertical Scroll Mode in Visual Studio 563 views
Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
Back to top
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com