Mac上的Git Hub桌面,错误:无法运行gpg:没有这样的文件或目录 [英] Git Hub Desktop on Mac, error: cannot run gpg: No such file or directory
问题描述
尝试使用GitHub Desktop提交更改,并获取以下信息:
Trying to commit my changes by using GitHub Desktop and getting this:
错误:无法运行gpg:没有此类文件或目录
error: cannot run gpg: No such file or directory
错误:无法运行gpg.
error: could not run gpg.
致命:未能写入提交对象 (128)
fatal: failed to write commit object (128)
首先,它也不适用于终端,我创建了gpg-key并插入到我的GitHub帐户中 现在它可以在终端机上正常工作,但桌面版仍然无法工作.
Firstly that not worked for terminal too and i create gpg-key and plugged in to my GitHub Account Now it's working well in Terminal but Desktop version still not working.
在GitHub Desktop的官方文档中,我发现了一些符号:
In Oficial doccumentation for GitHub Desktop i found some notation:
注意:GitHub Desktop不支持GPG签名.
Note: GitHub Desktop does not support GPG signing.
推荐答案
已解决.
因此,由于GitHub Desktop抱怨无法找到gpg(我已经通过自制软件安装了它),我认为应该有一种方法可以告诉git gpg的确切路径,结果是:
So as GitHub Desktop was complaining about not being able to find gpg (I had installed it via homebrew), I figured there should be a way to tell git the exact path of gpg, turns out there is:
gpg.program 制作或验证PGP签名时,请使用此自定义程序,而不要在$ PATH上找到"gpg".该程序必须支持与GPG相同的命令行界面,即,验证分离的签名,"gpg --verify $ file-https://git-scm.com/docs/git-config
gpg.program Use this custom program instead of "gpg" found on $PATH when making or verifying a PGP signature. The program must support the same command-line interface as GPG, namely, to verify a detached signature, "gpg --verify $file - https://git-scm.com/docs/git-config
因此,运行以下命令可以解决问题:
So running the following solved the problem:
git config --global gpg.program $(which gpg)
GitHub回到我的身边,并说一些用户还需要使用:
GitHub got back to me and said that some users also need to use:
echo "no-tty" >> ~/.gnupg/gpg.conf
这篇关于Mac上的Git Hub桌面,错误:无法运行gpg:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!