Is that good idea to disable gpg signin for code commits


I am using VS Code IDE with Angular in Windows 11. I have installed latest version of Git. When I do my code commit from Visual Studio Code. I am getting many errors Like

gpg: skipped "DFDFD": No secret key

Other one

Error: cannot spawn C:\Program Files (x86)\GnuPG\bin\gpg.exe: No such file or directory

If one is getting fixed other one started coming. How can I disable GPG for my code commit ? Is that good idea to disable it first of all ?

Edit 1
After running git config --global commit.gpgsign false command in Bash, getting below error. I opened Bash as admin

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
gpg: skipped "DFDFD": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object


Repository Level

To do it at the user level, run the following in whatever command-line tool you have.

git config commit.gpgsign false

Global Level

Run this command to disable the setting globally using thee --global flag.

git config --global commit.gpgsign false

On Windows, you might need to run this as an administrator.
Likewise—for a native *nix system (macOS, Linux, BSD) you should prefix with sudo to perform the action as a super user. If you are using wsl on Windows, then you may first need to run the following in order to act as root:

wsl --user root

VS Code Workspace

Type Cmd+Shift+P on macOS, or Ctrl+, on Windows, and open your settings. There are workspace settings and user settings. Uncheck "Enable Commit Signing" if it’s enabled.

screenshot of settings in VS code

If that doesn’t work, it’s got to be something with the local Git repository, or perhaps has to do with some other extension as it’s overriding your global settings with useConfigOnly=true.

Finally, you can try the above Repository Level settings from a terminal that’s opened at the path of the Git repository in question. You can do this in VS code by typing Ctrl+Opt+` or going to Terminal > New Terminal and executing the command there.

screenshot of terminal in VS Code

Answered By – AJAr

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published