git commit signing failed: secret key not available
<p>I am getting this error when trying to commit using Git.</p>

<pre><code>gpg: skipped "name &lt;name@mail.com&gt;": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
fatal: failed to write commit object
</code></pre>

<p>I have generated a new key as below but it still gives the same error</p>

<pre><code>gpg --list-keys
~/.gnupg/pubring.gpg
--------------------------------
pub   2048R/35F5FFB2 2016-04-23
uid                  name (New key) &lt;name@mail.com&gt;
sub   2048R/112A8C2D 2016-04-23
</code></pre>

<p>The secret key is the same as above</p>

<p>I have found this
 <a href="https://stackoverflow.com/questions/12061645/generating-a-gpg-key-for-git-tagging">Generating a GPG key for git tagging</a> and followed the steps but it still doesn't work, any idea?</p>