I changed my global Git configuration to sign all commits. I also use gpg-agent so that I don\'t have to type my password every time.
Now every time I make a new com
The accepted answer doesn't work for me for Git version 1.8.3.1
on Fedora 25
.
Check if gpg-agent
is running by
$ gpg-agent
Make sure gpg-agent
has your passphrase in cache. To make sure it is there, sign any file in the current directory. If the passphrase was not in the cache, it will be asked now.
$ gpg -s any-file.txt
Don't forget to delete the newly generated signed any-file.txt.gpg
$ rm any-file.txt.gpg
Now, signing commits with Git will work now by taking the required passphrase from gpg-agent.
$ git commit -S -m 'my commit message'
This is more a gpg configuration issue than a git one.
Since you are using an agent, you could as a workaround add no-tty
to your gpg.conf
.
echo 'no-tty' >> ~/.gnupg/gpg.conf
(this seems working even better than the --batch option)