I am getting this error when trying to commit using Git.
gpg: skipped \"name \": secret key not available
gpg: signing failed: secret ke
I had a situation in which the same was happening to me in a Windows 10 machine.
$ git commit -m "Improve logging, imports and show time executed"
gpg: signing failed: Operation cancelled
gpg: signing failed: Operation cancelled
error: gpg failed to sign the data
fatal: failed to write commit object
The commands "C:\Program Files (x86)\GnuPG\bin\gpg.exe" --list-secret-keys --keyid-format LONG and gpg --list-secret-keys --keyid-format LONG where giving me complete different results!
$ where gpg
C:\Program Files\Git\usr\bin\gpg.exe
C:\Program Files (x86)\GnuPG\bin\gpg.exe
The main reason was related to previous answers but on a different sense:
I hope this can help anyone that stumbles on this message and previous answers do not solve ther issue.