尝试使用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
Run Code Online (Sandbox Code Playgroud)
我已经生成了一个如下所示的新密钥,但它仍然会产生相同的错误
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
Run Code Online (Sandbox Code Playgroud)
密钥与上述相同
我发现这 为git标记生成一个GPG密钥并按照步骤但它仍然不起作用,任何想法?
我正在尝试使用git命令行在GitHub中创建签名标签.我用(样本)用户名生成了一个GPG密钥Full Name (skytreader) <fullname@gmail.com>.完成后,我尝试创建一个签名标签.但是我收到以下错误:
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
Run Code Online (Sandbox Code Playgroud)
我想我只需要用指定的用户名创建另一个密钥.但是,输入名称"full",gpg抱怨我的名字至少应该是5个字符.
如何在git中使用此密钥?
我是否更改了git用于使用GPG签署我的标签的用户名,以便获得至少5个字符长的真实姓名?
问题如何在Windows上使用IntelliJ等IDE进行git提交?
如果你有兴趣,请阅读我在这里尝试的内容:
我主要跟随Github的指南.我确保在更改配置文件后不要忘记重启bash/IntelliJ.
.gitconfig是相同的.git config --global commit.gpgsign true(我正在使用git 2.12).我做了一个新的提交并验证它已签名git verify-commit HEAD当我尝试在IntelliJ中提交时,我gpg: cannot open tty 'no tty'发现IntelliT在尝试签名提交(GPG)并添加no-tty到我的C:\Users\username\.gnupg\gpg.conf文件并重新启动时未能提交更改.
然后我得到了gpg: Sorry, no terminal at all requested - can't get input似乎合理的错误,因为我刚添加了与没有终端有关的选项.像gpg:抱歉,没有终端请求 - 无法获得输入说解决方案是删除no-tty我希望不适用于我的情况.
第一个问题中的其他答案建议use-agent在gpg.conf文件中添加,这会导致额外的错误gpg: gpg-agent is not available in this session.等等,也许我需要设置gpg-agent.
我能找到的最佳Windows指南是Archlinux wiki(是的,右).它指定添加到C:/Users/username/.gnupg/gpg-agent.conf …
我遵循这个教程:https://help.github.com/articles/signing-commits-using-gpg/
我这样做的时候会尝试签名:https: //github.com/spring-guides/tut-spring-boot-oauth2/commit/824f418ab9d04114b14a90f7c19b4b8d6dda67b7
但是错误:
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
Run Code Online (Sandbox Code Playgroud)
我的配置:
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 user.email=donhuvy@hotmail.com
file:C:/Users/Administrator/.gitconfig user.signingkey=DABDD34E
file:C:/Users/Administrator/.gitconfig commit.gpgsign=true
file:C:/Users/Administrator/.gitconfig …Run Code Online (Sandbox Code Playgroud) 我不能每次都禁用输入密码,我如何进行提交。
我安装并设置了Gpg4win吗?我移到带有.git子文件夹的文件夹?
git add .,git commit -m "Any description"。成功签署的提交,无需输入密码。
我进入窗口,在这里我需要输入密码:

pinentry-qt
请输入密码以解锁OpenPGP密钥:
每次提交时,我都需要输入密码。
???? exclude:两次提交之间的间隔时间。
我发现我的USERPROFILE文件夹- C:\Users\SashaChernykh- .gnupg\gpg-agent.conf文件。我尝试将no-tty,batch或no-use-agent行添加到此文件:
no-tty
batch
no-use-agent
Run Code Online (Sandbox Code Playgroud)
我仍然得到实际的行为,这不是预期的。