{"thread":{"id":"50536","subject":"default gpg signing key","startedAt":"2019-02-18T20:14:32Z","lastAt":"2019-02-18T21:29:57Z","messageCount":2,"participants":["Marco Sirabella","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"369551","messageId":"20190218201232.pqyy3kws75zduq7g@Ridl3y","threadId":"50536","inReplyTo":null,"subject":"default gpg signing key","fromName":"Marco Sirabella","fromEmail":"marco@sirabella.org","sentAt":"2019-02-18T20:12:32Z","receivedAt":"2019-02-18T20:14:32Z","isPatch":false,"sender":{"key":"marco@sirabella.org","avatar":"https://gravatar.com/avatar/7631f17688dcadb421a7b8973b3a2dae999701f22d238ae3cbc0b80e17d4c6d1?d=mp&s=160"},"body":"Hi all,\n\nWhen signing a commit with git, the newer of two signing keys under my main\nmaster key is used. This is even the case when `default-key` is set in\n`gpg.conf` (`gpg --sign` uses the correct key).\n\nIs there any way to tell git to not use the `--local-user` flag when signing,\nand just let `gpg` decide which key to sign with? Or is `gpg.signingKey` in the\nconfig the way to go?\n\nThanks,\n\n-- Marco Sirabella\n"},{"id":"369569","messageId":"20190218212944.GM684736@genre.crustytoothpaste.net","threadId":"50536","inReplyTo":"20190218201232.pqyy3kws75zduq7g@Ridl3y","subject":"Re: default gpg signing key","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-02-18T21:29:45Z","receivedAt":"2019-02-18T21:29:57Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Mon, Feb 18, 2019 at 03:12:32PM -0500, Marco Sirabella wrote:\n> Hi all,\n> \n> When signing a commit with git, the newer of two signing keys under my main\n> master key is used. This is even the case when `default-key` is set in\n> `gpg.conf` (`gpg --sign` uses the correct key).\n> \n> Is there any way to tell git to not use the `--local-user` flag when signing,\n> and just let `gpg` decide which key to sign with? Or is `gpg.signingKey` in the\n> config the way to go?\n\nI typically use user.signingKey for this purpose. The benefit of using\nlocal-user by default is that we serialize the email address in the\nsignature as the signer, which is valuable when a person has multiple\nemail addresses on their key.\n\nWe do have this functionality in the author and committer fields, but\nembedding it in the signature ensures that the signature can't be\nverified without it.\n\nAlso, without specifying -u, we'd pick whatever key was the default in\nthe keyring, even if the email address for that key was wrong for the\ncommit.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}