git commit签名失败:密钥不可用 [英] git commit signing failed: secret key not available

查看:904
本文介绍了git commit签名失败:密钥不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  gpg:跳过了name< name @ mail。密码不可用
gpg:签名失败:密钥不可用
错误:gpg未能签署数据
致命:未能写入提交对象
code>

我已经生成了一个新的密钥,但它仍然会给出相同的错误。

  gpg --list-keys 
〜/ .gnupg / pubring.gpg
---------------- ----------------
pub 2048R / 35F5FFB2 2016-04-23
uid name(New key)< name@mail.com>
sub 2048R / 112A8C2D 2016-04-23

密钥与上述相同



我发现这
为git tagging生成一个GPG密钥并遵循这些步骤,但它仍然无效,有什么想法? / b>你需要在使用它之前配置密钥。

  git config user.signingkey 35F5FFB2 

如果您打算为每个存储库使用相同的密钥,或者是全局的。

  git config --global user.signingkey 35F5FFB2 

来源: https://git-scm.com/book/es / v2 / Git-Tools-Signing-Your-Work

I am getting this error when trying to commit using Git.

gpg: skipped "name <name@mail.com>": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
fatal: failed to write commit object

I have generated a new key as below but it still gives the same error

gpg --list-keys
~/.gnupg/pubring.gpg
--------------------------------
pub   2048R/35F5FFB2 2016-04-23
uid                  name (New key) <name@mail.com>
sub   2048R/112A8C2D 2016-04-23

The secret key is the same as above

I have found this Generating a GPG key for git tagging and followed the steps but it still doesn't work, any idea?

解决方案

You need to configure the secret key before using it.

git config user.signingkey 35F5FFB2

Or global if you are going to use the same key for every repository.

git config --global user.signingkey 35F5FFB2

Source: https://git-scm.com/book/es/v2/Git-Tools-Signing-Your-Work

这篇关于git commit签名失败:密钥不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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