I needed a fast way to add gpg keys to repos on my machine for different email addresses, this small tool solves that for me
-
Run
gpg-gen
copy, paste and run cmd on about section to generate a key, pick default opts -
Run
gpg-gen keys
-
To pick a key for step
Example:
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot <hubot@example.com>
ssb 4096R/4BB6D45482678BE3 2016-03-10
- Key id would be:
3AA5C34371567BD2
- Email would be:
hubot@example.com
- Run
gpg-gen add --key <key-id> --email <email>
- Run
gpg-gen github --key <key-id>
add the generated token to your github profile GPG Keys, make sure the same email address used with the key is also linked to your github account
- Copy repo to local
- Run
go build && go install
nowgpg-gen
is part of your./bin/go
path