Reputation: 71
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
Upvotes: 7
Views: 9462
Reputation: 221
For me, the right answer was
git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe" which I found here
in your .gitconfig it must be shown like this:
[gpg]
program = C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe
Upvotes: 0
Reputation: 189
I also faced this issue and was able to fix it by removing quotes for the gpg.exe program line in .gitconfig file.
.gitconfig file before update =>
[gpg] program = 'C:\Users\TEST\AppData\Local\GnuPG\bin\gpg.exe'
.gitconfig file after update =>
[gpg] program = C:\Users\TEST\AppData\Local\GnuPG\bin\gpg.exe
Upvotes: 2
Reputation: 4011
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.
Upvotes: 9
Reputation: 5961
Judging from the error message:
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
you have git gpg signing turned on but no GnuPG installed. Either install it or turn off commit gpg signing. You can disable commit signing using --no-gpg-sign
flag on a particular commit command:
git commit --no-gpg-sign
or disable it permanently by modyfing your global .gitconfig
:
git config --global commit.gpgsign false
Upvotes: 5