为git标记生成GPG密钥 [英] Generating a GPG key for git tagging

查看:110
本文介绍了为git标记生成GPG密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用git命令行在GitHub中创建签名标签。我使用(样本)用户名全名(skytreader)< fullname@gmail.com> 生成了一个GPG密钥。完成之后,我尝试创建一个签名标记一>。但是,我收到以下错误:

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

我想我只需要用指定的用户名创建另一个密钥。但是,输入名称full, gpg 会抱怨我的名字长度不得少于5个字符。

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.

如何在Git中使用此密钥?

How do I use this key with git?

我是否更改git用于使用GPG为我的代码签名的用户名,以便获得至少5个字符的真实姓名?

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?

推荐答案

提交者名称位于〜/ .gitconfig 文件。将该条目更改为真实姓名(无论如何,您都希望这样做)。您可以在您最喜爱的编辑器中编辑文件,或者发布:

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>"

这篇关于为git标记生成GPG密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆