Anytime I've tried to commit a change through the command line I've received this error message:
error: cannot spawn gpg2: No such file or directory
Update: I'm running Windows 10
(using Github Desktop in Windows 10)
after making new gpg like in below link, (I wanted to sign my commits)
https://gist.github.com/BoGnY/f9b1be6393234537c3e247f33e74094a
in command, I could use git commit
without any errors.
but in the desktop application, I got the same error, and setting gpg path worked for me. (with verified commit with app)
where gpg
it will give something like "C:\Program Files\Git\usr\bin\gpg.exe"
and using git bash, try this command
git config --global gpg.program "/c/Program Files/Git/usr/bin/gpg.exe"
By default, the program used to sign commits is gpg
. On your system, it's been configured to gpg2
.
Normally, signed commits are only generated when you either specify them with -S
or when you have commit.gpgsign
set to true
, in which case all commits are signed. If you want to continue to sign commits, you can change the binary used to sign them by running git config --global gpg.program gpg
, assuming that gpg
exists on your system. (You can check by running command -v gpg
and seeing if it provides any output.)
If gpg
doesn't exist on your system, you can install it from your system package manager. Often the name of the package is gnupg
, but it may differ. You haven't said what operating system you're using, so we can't provide you more specific information.
If you don't want to sign commits, then you can run git config --unset-all commit.gpgsign
and signing will default to being disabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With