A failed git checkout feels like hitting a locked door you know you have the key for. You type the command. You expect the branch to switch immediately. Instead, GPG steps in. It asks for a passphrase. Your smooth workflow is gone.
When Git is set up with commit signing, GPG can trigger in places you don’t expect—especially during git checkout. This happens when Git needs to verify or re-sign commits during operations like rebasing or switching branches that carry signed history. If your signing key is misconfigured, expired, or inaccessible, the checkout fails.
The fix begins with understanding how Git and GPG interact. Run:
git config --get user.signingkey
gpg --list-secret-keys --keyid-format LONG
Make sure your signing key matches the one GPG recognizes. If Git can’t see it, point Git to the correct key ID:
git config --global user.signingkey <your-key-id>
If GPG prompts keep interrupting, use gpg-agent for caching. Start by ensuring the agent is running: