commit results in: error: gpg failed to sign the data

299 Views Asked by At

For 3 days now I'm not being able to commit, push and so on (althoug I can clone). It started after setting gpg key and forgetting the secret phrase. Have changed gpg keys various times, and know I deleted all of them trying to commit with no signature, but I'm not being successfull. Installed the last version of Git, but cannot find a solution. I'm a begginer. Appreciate the help.

cgkru@Graci-LapTop MINGW64 ~/Documents/Teste (main)
$ git init
Reinitialized existing Git repository in C:/Users/cgkru/Documents/Teste/.git/

cgkru@Graci-LapTop MINGW64 ~/Documents/Teste (main)
$ git add index.html

cgkru@Graci-LapTop MINGW64 ~/Documents/Teste (main)
$ git add style.css

cgkru@Graci-LapTop MINGW64 ~/Documents/Teste (main)
$ git add README.md
cgkru@Graci-LapTop MINGW64 ~/Documents/Teste (main)
$ ls -la
total 9
drwxr-xr-x 1 cgkru 197610  0 May 26 19:49 ./
drwxr-xr-x 1 cgkru 197610  0 May 27 15:22 ../
drwxr-xr-x 1 cgkru 197610  0 May 28 08:54 .git/
-rw-r--r-- 1 cgkru 197610  0 May 26 19:15 index.html
-rw-r--r-- 1 cgkru 197610  0 May 26 19:17 README.md
-rw-r--r-- 1 cgkru 197610 59 May 26 19:34 style.css

cgkru@Graci-LapTop MINGW64 ~/Documents/Teste (main)
$ GIT_TRACE=1 git commit -m "first commit"
08:54:28.399551 exec-cmd.c:237          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
08:54:28.404550 git.c:459               trace: built-in: git commit -m 'first commit'
08:54:28.445273 run-command.c:654       trace: run_command: C:Program -bsau 423327BD08912855
error: cannot spawn C:Program: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
1

There are 1 best solutions below

1
On

Problem Solved! I disabled gpg sign

git config --global commit.gpgsign false

Found the answer in this post [https://stackoverflow.com/questions/39274739/how-to-disable-git-gpg-signing][1]