I'm trying to create signed tags in GitHub using the git command line. I generated a GPG key with a (sample) username Full Name (skytreader) <fullname@gmail.com>
. Having done that, I try to create a signed tag. However I get the following error:
gpg: skipped "full <fullname@gmail.com>": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag
I figure that I just need to create another key with the indicated username. But then, entering the name "full", gpg
complains that my name should be at least 5 characters long.
How do I use this key with git?
Do I change the username git uses for signing my tags with GPG so that I get a real name at least 5 chars long?
If you have a key already generated, you can tell git to use that specific key without worrying about matching between your git user ID (name+email) and the GPG key's ID. You should have your git
user.email
match one of the emails on your GPG key for your signed tags or commits to be useful to other users, though.To set the key for global use on your computer, set your git global config with:
Or, you can set the
user.signingkey
for only the current repository you're in with:First you need check if there is a gpg key for your ID.
If you have should appear something like this:
If there is no gpg key. You should create
Next you have this output:
The committer name is located in your
~/.gitconfig
file. Change that entry to a real name (which is how you want to be committing, anyway). You can edit the file in your favorite editor, or just issue: