gpt4 book ai didi

git - 为什么在我没有配置签名时源代码树会查找 gpg key ?

转载 作者:太空狗 更新时间:2023-10-29 14:44:04 24 4
gpt4 key购买 nike

我下载了sourcetree app在我的 Mac 上添加了一个本地 git 仓库。每当我尝试 stash 或提交某些内容时,sourcetree 都会抛出与 gpg 相关的错误。错误示例如下。

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree stash save test-stash 
/Applications/SourceTree.app/Contents/Resources/bin/gpg: line 2: gpg2: command not found
error: gpg failed to sign the data
Cannot save the current index state
Completed with errors, see above

我无法找出此错误的原因。据我所知,我没有为任何类型的签名配置项目或 sourcetree 应用程序。

如果你能帮助我解决这个问题,那将是一个很大的帮助。

最佳答案

即使我尝试从命令行提交,它也会要求提供 gpg key 。

在互联网上进行了大量搜索后,我找到了根本原因。这是由于将 ~/.gitconfig 中用于签署提交的全局配置设置为 true 的点文件之一。因此,我使用以下命令将配置设置回 false。

$ git config --global commit.gpgsign false

呸!现在问题已经解决了...

关于git - 为什么在我没有配置签名时源代码树会查找 gpg key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39130532/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com