如何禁用 git gpg 签名

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39274739/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:29:15  来源:igfitidea点击:

How to disable git gpg signing

gitatlassian-sourcetreesourcetree

提问by Thellimist

I'm using git gpg signing. I want to disable it. I've set .gitconfig

我正在使用 git gpg 签名。我想禁用它。我已经设置了.gitconfig

[user]
    name = NAME
    email = EMAIL
    signingkey = KEY
...
[commit]
    gpgsign = false

My commits are still signing by default.

我的提交仍然默认签名。

PS: I also disabled from Sourcetree Repository/ Repository Settings/Securitytab. Both Sourcetree and terminal forces to use gpg.

PS:我也禁用了 SourcetreeRepository/ Repository Settings/Security选项卡。Sourcetree 和终端都强制使用 gpg。

回答by Edward Loveall

You can disable this by running git config commit.gpgsign falseThis sets the configuration locally instead of globally.

您可以通过运行git config commit.gpgsign falseThis 本地而不是全局设置配置来禁用它。

Putting this setting in .gitconfig worked for me with what you had, without the [user] configuration:

将这个设置放在 .gitconfig 中对我有用,没有 [user] 配置:

[commit]
    gpgsign = false

回答by friederbluemle

To temporarily disable GPG signing for the next commit:

为下一次提交暂时禁用 GPG 签名:

git -c commit.gpgsign=false commit

回答by Gayan Weerakutti

To unsign the last commit:

要取消对最后一次提交的签名:

git commit --amend --no-gpg-sign

-no-gpg-sign

-no-gpg-sign

Countermand commit.gpgSignconfiguration variable that is set to force each and every commit to be signed.

Countermandcommit.gpgSign配置变量设置为强制对每个提交进行签名。