git-secret icon indicating copy to clipboard operation
git-secret copied to clipboard

Can't use git secret tell when multiple pub keys for same email are in GPG storage

Open sukhmel opened this issue 2 months ago • 0 comments

Steps to reproduce:

  1. import public key with several records:
    ▷ LC_ALL=C gpg --import public-key.gpg 
    gpg: key 9BACDE82519B7881: "name.surname <[email protected]>" imported
    gpg: key F0802AAE7933C814: "Name Surname < [email protected] >" imported
    gpg: Total number processed: 2
    gpg:               imported: 2
  1. Try to tell a secret:
▷ git secret tell [email protected]
git-secret: abort: 2 keys found in gpg user keyring for: [email protected]

Workaround:

  1. Remove key, you will have to specify full name with email to be able to choose which to remove, otherwise it only removes the first found for the email:
▷ LC_ALL=C gpg --delete-keys "Name Surname < [email protected] >"
gpg (GnuPG) 2.4.8; Copyright (C) 2025 g10 Code GmbH
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


pub  ed25519/F0802AAE7933C814 2025-10-17 Name Surname < [email protected] >
Delete this key from the keyring? (y/N) y

Expected behaviour:

I find it reasonable to be able to specify full name when doing git secret tell same as with gpg, but it seems not supported?

▷ git secret tell "Name Surname < [email protected] >"
git-secret: abort: no key found in gpg user keyring for: Name Surname < [email protected] >

sukhmel avatar Oct 17 '25 10:10 sukhmel