Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
479 views
in Technique[技术] by (71.8m points)

gnupg - Generating a GPG key for git tagging

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) <[email protected]>. Having done that, I try to create a signed tag. However I get the following error:

gpg: skipped "full <[email protected]>": 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?

question from:https://stackoverflow.com/questions/12061645/generating-a-gpg-key-for-git-tagging

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

git config --global user.name "<name>"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...