问题描述
我遵循以下教程:
我的配置:
C:\ Users \Administrator\Desktop\foo\test_gpg> ; git config --list --show-origin
file:C:\\ Program Data / Git / configcore.symlinks = false
file:C:\\ Program Data / Git / configcore.autocrlf = tr ue
file:C:\\ProgramData / Git / configcore.fscache = true
file:C:\\ProgramData/Git/configcolor.diff = auto
文件:C:\\ProgramData / Git / configcolor.status = auto
file:C:\\ProgramData/Git/configcolor.branch = auto
文件:C:\\ProgramData/Git/configcolor.interactive = true
file:C:\\ProgramData/Git/confighelp.format = html
file :C:\\ Program Data / Git / confighttp.sslcainfo = C:/ Program Files / Git / mingw64 / ssl / certs / ca-bundle.crt
file:C:\\ ProgramData / Git / configdiff.astextplain.textconv = astextplain
file:C:\\ Program Data / Git / configrebase.autosquash = true
file:C:\\ Program Files \\Git\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\\\\\\' /Users/Administrator/.gitconfig [email protected]
fi le:C:/Users/Administrator/.gitconfig user.signingkey = DABDD34E
文件:C:/Users/Administrator/.gitconfig commit.gpgsign = true
文件:C:/ Users / Administrator /。 gitconfig use.signingkey = DABDD34E
file:.git / config core.repositoryformatversion = 0
file:.git / config core.filemode = false
file:.git / config core.bare = false
file:.git / config core.logallrefupdates = true
file:.git / config core.symlinks = false
file:.git / config core.ignorecase = true
file:.git / config core.hidedotfiles = dotGitOnly
file:.git / config remote.origin.url = https://github.com/donhuvy/test_gpg.git
file:.git / config remote.origin.fetch = + refs / heads / *:refs / remotes / origin / *
file:.git / config branch.master.remote = origin
file:.git / config branch.master .merge = refs / heads / master
file:.git / config commit.gpgsign = true
和
C:\ Users \Adminis trator \Desktop\foo\test_gpg> gpg --list-key
C:/Users/Administrator/AppData/Roaming/gnupg/pubring.gpg
--------- -----------------------------------------------
pub 2048R / DABDD34E 2016-06-10
uid [终极] donhuvy(Do Nhu Vy)< [email protected]>
uid [终极] Do Nhu Vy(Do Nhu Vy)< [email protected]>
sub 2048R / C6B535A2 2016-06-10
(我用GitHub注册3封电子邮件: [email protected]
, [email protected]
和 [email protected]
)
我错了什么?我如何签署我的提交?
我也有同样的问题。不幸的是,错误信息并没有指出真正的问题....这是你没有配置git来使用你正在使用的gpg程序,我怀疑它是gpg4win。[我只在Win机器上遇到过这个问题] p>
git config --global gpg.programC:/ Program Files(x86)/GNU/GnuPG/gpg2.exe
请执行以下命令,然后执行下面的命令。
git config user.signingkey DABDD34E
您需要重启终端;并重新发布您的 git commit
命令。
希望这有助于您。
I follow this tutorial: https://help.github.com/articles/signing-commits-using-gpg/
I try to sign when commit like this:https://github.com/spring-guides/tut-spring-boot-oauth2/commit/824f418ab9d04114b14a90f7c19b4b8d6dda67b7
but error:
C:\Users\Administrator\Desktop\foo\test_gpg>git commit -m "test"
gpg: skipped "DABDD34E": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
fatal: failed to write commit object
My config:
C:\Users\Administrator\Desktop\foo\test_gpg>git config --list --show-origin
file:"C:\\ProgramData/Git/config" core.symlinks=false
file:"C:\\ProgramData/Git/config" core.autocrlf=true
file:"C:\\ProgramData/Git/config" core.fscache=true
file:"C:\\ProgramData/Git/config" color.diff=auto
file:"C:\\ProgramData/Git/config" color.status=auto
file:"C:\\ProgramData/Git/config" color.branch=auto
file:"C:\\ProgramData/Git/config" color.interactive=true
file:"C:\\ProgramData/Git/config" help.format=html
file:"C:\\ProgramData/Git/config" http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
file:"C:\\ProgramData/Git/config" diff.astextplain.textconv=astextplain
file:"C:\\ProgramData/Git/config" rebase.autosquash=true
file:"C:\\Program Files\\Git\\mingw64/etc/gitconfig" credential.helper=manager
file:C:/Users/Administrator/.gitconfig user.name=donhuvy
file:C:/Users/Administrator/.gitconfig [email protected]
file:C:/Users/Administrator/.gitconfig user.signingkey=DABDD34E
file:C:/Users/Administrator/.gitconfig commit.gpgsign=true
file:C:/Users/Administrator/.gitconfig use.signingkey=DABDD34E
file:.git/config core.repositoryformatversion=0
file:.git/config core.filemode=false
file:.git/config core.bare=false
file:.git/config core.logallrefupdates=true
file:.git/config core.symlinks=false
file:.git/config core.ignorecase=true
file:.git/config core.hidedotfiles=dotGitOnly
file:.git/config remote.origin.url=https://github.com/donhuvy/test_gpg.git
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config branch.master.remote=origin
file:.git/config branch.master.merge=refs/heads/master
file:.git/config commit.gpgsign=true
and
C:\Users\Administrator\Desktop\foo\test_gpg>gpg --list-key
C:/Users/Administrator/AppData/Roaming/gnupg/pubring.gpg
--------------------------------------------------------
pub 2048R/DABDD34E 2016-06-10
uid [ultimate] donhuvy (Do Nhu Vy) <[email protected]>
uid [ultimate] Do Nhu Vy (Do Nhu Vy) <[email protected]>
sub 2048R/C6B535A2 2016-06-10
(I register 3 emails with GitHub: [email protected]
, [email protected]
and [email protected]
)What I have been wrong? How I sign my commit?
I too had the same problem. Unfortunately the error message does not pinpoint the real issue....which is that you have not configured git to use the gpg program you are using, which I suspect is gpg4win.[I have encountered this only on a Win machine]
git config --global gpg.program "C:/Program Files (x86)/GNU/GnuPG/gpg2.exe"
Please run the above command followed by the below.
git config user.signingkey DABDD34E
You many need to restart the terminal ; and reissue your git commit
command.
Hope this helps.
这篇关于gpg:跳过“XXBDXX4E”:密钥不可用。 gpg:签名失败:密钥不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!