git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git uses wrong subkey for signing commits with GPG key

From
Todd Zullinger <tmz@pobox.com>
Date
Jan 13, 2018, 17:25 UTC
Message-ID
<20180113172555.GS29313@zaya.teonanacatl.net>
In-Reply-To
<CAHLNBdUTWTbvkLdqbvB-1vs=oPJOHP5S3CWMZbtCgBnJNh4hRQ@mail.gmail.com>
Andrzej Ośmiałowski wrote:
> On Sat, Jan 13, 2018 at 1:22 AM, Todd Zullinger <tmz@pobox.com> wrote:
>> I could be wrong, but I think you need to append '!' to
>> KEYID to force gpg to use that specific signing subkey.
[...]
> thanks for reply. You just solved my issue. I will prepare a PR to the
> docs to add relevant information.

Glad it helped. The git-tag documentation points to git-config and the user.signingKey variable in the CONFIGURATION section. The git-config documentation for that variable currently says:

    If linkgit:git-tag[1] or linkgit:git-commit[1] is not selecting the
    key you want it to automatically when creating a signed tag or
    commit, you can override the default selection with this variable.
    This option is passed unchanged to gpg's --local-user parameter,
    so you may specify a key using any method that gpg supports.

Whether that can be improved without being too verbose (or duplicating too much of the gpg documentation), I don't know.

Maybe it could point to the gpg documentation, though that can be in gpg(1), gpg1(1), or gpg2(1), depending on how their system installs gpg.

The online link covering the many formats that gpg accepts for the --local-user (-u) option is:

    https://www.gnupg.org/documentation/manuals/gnupg/Specify-a-User-ID.html
-- 
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is impossible to enjoy idling thoroughly unless one has plenty of
work to do.
    -- Jerome K. Jerome
Previous: Andrzej OśmiałowskiNext: Junio C Hamano
Message 4 of 5 in “Git uses wrong subkey for signing commits with GPG key”
  1. Andrzej OśmiałowskiJan 13, 2018
  2. Todd ZullingerJan 13, 2018
  3. Andrzej OśmiałowskiJan 13, 2018
  4. Todd ZullingerJan 13, 2018
  5. Junio C HamanoJan 16, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.