gpg无法写入提交对象

时间:2020-09-28 14:46:30

标签: git gnupg

编辑---

就像Torek所说的那样,问题似乎出在我的phpstorm上的路径配置错误(当我直接提交到控制台时,它可以工作)。我试图在相应的菜单中添加路径(例如:function encode(i, j) { return i | (j << 8); } function decode(x) { return [x & 0xff, x >> 8]; } ),但这并没有任何改变……我一直在寻找。


问题---

我遇到此错误,我提交了一些文件:

gpg2 in path /usr/bin/gpg2

或者,如果我使用16:11 Commit failed with error 0 file committed, 1 file failed to commit: ? add readme gpg failed to sign the data failed to write commit object

git config --global gpg.program gpg2

如果我使用16:25 Commit failed with error 0 file committed, 1 file failed to commit: ? add readme cannot run gpg2: No such file or directory gpg failed to sign the data failed to write commit object 测试gpg2签名,则结果如下:

echo "test" | gpg2 --clearsign

我尝试遵循此解决方案(除其他方法外),但无济于事:

我的钥匙像这样:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

test
-----BEGIN PGP SIGNATURE-----

123412341231234123412312341234123123412341231234123412312341234123
123412341231234123412312341234123123412341231234123412312341234123
123412341231234123412312341234123123412341231234123412312341234123
123412341231234123412312341234123123412341231234123412312341234123
1234123412312341234123==
=UXT0
-----END PGP SIGNATURE-----

和我的git配置:

➜ gpg2 -K --keyid-format SHORT       
/home/hadock/.gnupg/pubring.kbx
-------------------------------
sec   rsa3072/11224455 2020-09-28 [SC] [expires: 2022-09-28]
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
uid         [ultimate] Jon Doe <jondoe@gmail.com>
ssb   rsa3072/87654321 2020-09-28 [E] [expires: 2022-09-28]

我创建的密钥为this page suggests,但与➜ git config --global gpg.program gpg2 ➜ git config --global commit.gpgsign true ➜ git config --global user.signingkey 11224455 的结果不同:

  • 他们的展示
gpg --list-keys
  • 我的展示
$ gpg --list-keys
/Users/schacon/.gnupg/pubring.gpg
---------------------------------
pub   2048R/0A46826A 2014-06-04
uid                  Scott Chacon (Git signing key) <schacon@gmail.com>
sub   2048R/874529A9 2014-06-04

0 个答案:

没有答案