Git pushes can be signed with
git push --signed
Is it possible to specify with which gpg key to sign the push? The manpage of git push
does not specify anything and looking through the configuration options there only seems to be
user.signingkey
to specify the signing key for signed commits.
To sign a tag, add -s to your git tag command. Verify your signed tag by running git tag -v [tag-name] .
No simple switch solution, sadly...
But maybe you might be happy creating an alias for signed commits, such as:
$ git config --global alias.ptest '!git config user.signingkey KEY && git push --signed'
$ git config --global alias.pdev '!git config user.signingkey KEY2 && git push --signed'
Arguments should be passed to the push
without issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With