Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pick with which key to sign a git push?

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.

like image 381
Thomas Avatar asked Aug 10 '15 11:08

Thomas


People also ask

How do I sign a git tag?

To sign a tag, add -s to your git tag command. Verify your signed tag by running git tag -v [tag-name] .


1 Answers

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.

like image 84
petrpulc Avatar answered Nov 02 '22 04:11

petrpulc