Git GPG error signing tags

来源:互联网 发布:数据库模式怎么理解 编辑:程序博客网 时间:2024/05/21 07:54

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 informationgpg: skipped "Name <name@gmail.com>": secret key not availablegpg: signing failed: secret key not availableerror: gpg failed to sign the dataerror: 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 availablegpg: signing failed: secret key not availableerror: gpg failed to sign the dataerror: unable to sign the tag

EDIT:

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

Name@NAME-PC ~$ gpg --list-secret-keysgpg: keyblock resource `c:/Users/Name/.gnupg\secring.gpg': file open errorgpg: keyblock resource `c:/Users/Name/.gnupg\pubring.gpg': file open errorgpg: 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 .gnupgxcopy 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
原创粉丝点击