Update the docs for GPG for gpg2 - [secret key not available]
On Ubuntu 16.04.x gpg2 is installed and can be used instead of gpg which is in the latest docs published for GPG with 9.5 release.
All good if you use gpg2 instead of gpg, but the problem starts when we sign the commit:
git commit -S -m "sign the commit"
Error thrown maybe vary, but common one is:
gpg: skipped "XTTXXXX": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
fatal: failed to write commit object
This does not mean one don't have the secret key, its because git is using gpg instead of gpg2. This command will fix it:
git config --global gpg.program gpg2
And try to commit again, voila.. it works.