如何禁用 git gpg 签名

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

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

默认情况下,我的提交仍然处于签名状态。

PS: 我还禁用了来源树 Repository/ Repository Settings/Security选项卡。来源树和终端都强制使用 gpg。

61828 次浏览

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

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

[commit]
gpgsign = false

To temporarily disable GPG signing for the next commit:

git -c commit.gpgsign=false commit

To unsign the last commit:

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

-no-gpg-sign

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

To disable Git GPG signing for every repository on your computer

git config --global commit.gpgsign false

To disable Git GPG signing for a single repository

git config commit.gpgsign false

If you want to enable GPG signing again just replace false with true