Git GPG error signing tags

http://stackoverflow.com/questions/16876817/git-gpg-error-signing-tags

gotOK I'm a bit of a rookie when it comes to Git. So I decided to read Pro Git by Scott Chacon. BTW great book, highly recommend it.

Anyway got to the section about Signed Tags. To sign a tag with GPG you must have a private key set up which I do. However, when I ran:

git tag -s v1.6 -m "my signed 1.6 tag"

I got the following:

C:\Users\Name\Desktop\git>git tag -s v1.6 -m "my signed 1.6 tag"
gpg: error loading `iconv.dll': The specified module could not be found.

gpg: please see http://www.gnupg.org/download/iconv.html for more information
gpg: skipped "Name <name@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

So, I done what the error message told me to do and went to the link and followed the instructions. I copied iconv.dll to the folder that contained gpg.exe (\Git\bin). Ran the command again and got:

C:\Users\Name\Desktop\git>git tag -s v1.6 -m "my signed 1.6 tag"
gpg: skipped "Name <name@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

EDIT:

When I try and list my secret keys I get this error???

Name@NAME-PC ~
$ gpg --list-secret-keys
gpg: keyblock resource `c:/Users/Name/.gnupg\secring.gpg': file open error
gpg: keyblock resource `c:/Users/Name/.gnupg\pubring.gpg': file open error
gpg: fatal: c:/Users/Name/.gnupg: directory does not exist!
secmem usage: 0/0 bytes in 0/0 blocks of pool 0/32768


Answer



You could initialize your gnupg environment (secret key) with a gpg GUI like gpg4win, following this tutorial, or (more up-to-date) the official gpg4win documentation "Gpg4win for Novices".

private key creation

Note that this blog post add the following caveat:

I installed Gpg4win, which installs a nice GUI for managing keys and the GPG command line interface.
My ignorance of the process was clear as I repeatedly attempted to use the GUI (GNU Privacy Assistant – Key Manager) to create my key. That GUI appears to create valid keys, but wherever it stores the related key part files is not where the GPG command line expects to find them.

(Note: probably on C:\Users\Name\AppData\Roaming\gnupg, with a directory was named gnupgand not .gnupg)

Instead, be sure to use the command line client. Start with:

gpg --gen-key

If key creation fails, you might manually need to create the directory c:users<USER>.gnupg, which GPG will apparently not do on its own.

cd C:\Users\Name 
mkdir .gnupg
xcopy C:\Users\Name\AppData\Roaming\gnupg .gnupg

The errors that I was seeing along the way were

gpg: no writable public keyring found

and:

signing failed: secret key not available

Note: once your gnupg is in place, if you still have the error message, do add the the (gnupg) key-idyou want to use when signing your tag:

git tag -u 'key-id' -s -m "some comment" some-tag 

http://portableapps.com/node/2011


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值