TIL Find current git signing key + scope with git config

I switched back to an old laptop and was having trouble with git commit complaining about the passphrase I was using. It was the correct passphrase -- for a different key. I spent a little time with git config to record a few queries for how to find the current git signing key.

You'll want one if you want to sign commits with your SSH key. That's how you get the pretty Verified badge on commits like this one.

git config --show-scope --get user.signingkey

The --show-scope option is a nice bonus as you get to see where the signing key has been configured. From the usage notes on git config:

    --show-scope          show scope of config (worktree, local, global, system, command)

This is nice a nice option when you want to understand where a specific config is coming from. To take a look your git config for the directory you are in currently, consider:

git config --list --show-scope

ℹ️ About this TIL snippet: Created 2023-07-29T16:04:24-04:00 · View the source