Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remember GPG password when signing git commits

Tags:

git

shell

gnupg

Would it be possible for the GPG password to be saved, so that I am not prompted for the passphrase everytime I make a git commit?

like image 992
gauge Avatar asked Apr 25 '16 17:04

gauge


People also ask

Where is GPG passphrase stored?

The passphrase itself is not stored anywhere and thus cannot be displayed. The decryption process works anyway by repeatedly applying a secure hash algorithm to a concatenation of the passphrase being input and a salt value (a random number) read from the key ring.

How do I turn off GPG signing?

You can disable this by running git config commit. gpgsign false This sets the configuration locally instead of globally.

What is GPG key in git?

About GPG keys GPG is a command line tool used together with Git to encrypt and sign commits or tags to verify contributions in Bitbucket. In order to use GPG keys with Bitbucket, you'll need generate a GPG key locally, add it to your Bitbucket account, and also set it up for use with Git.


1 Answers

You can set a timeout period for gpg-agent in ~/.gnupg/gpg-agent.conf with this line:

default-cache-ttl 3600 

That would tell gpg-agent to store the passphrase for one hour. You wouldn't want it to be indefinite, but not constantly typing it is of benefit too.

like image 60
Ben Avatar answered Sep 27 '22 20:09

Ben