Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git commit error: cannot spawn gpg.exe: No such file or directory

This is what I am getting as output when I am trying to commit any file. I tried installing git again and watched some tutorials on youtube to get it started again but it didn't work. Still getting the same error:

error: cannot spawn C:\Program Files (x86)\GnuPG\bin\gpg.exe: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
like image 264
Avinash Kumar Avatar asked Jul 15 '26 02:07

Avinash Kumar


1 Answers

If you are using Git bash in Windows to generate the key instead of GnuPG Win, then you need to update the git config to point to the right location of gnupg. Run the following command in git bash with the correct location.

git config --global gpg.program /usr/bin/gpg

If you don't know the location run which gpg in git bash to obtain the location.

like image 119
Kolappan N Avatar answered Jul 18 '26 02:07

Kolappan N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!