- Install
gpg-agent
$ brew install gpg-agent
- You'll want to start
gpg-agenteach time a shell is opened. Add the following lines to your~/.profileor equivalent:
GPG_TTY=$(tty)
export GPG_TTY
eval $(gpg-agent --daemon --allow-preset-passphrase)
- Edit the
~/.gnupg/gpg.conffile and uncomment theuse-agentline. - Open a new shell (so new settings take effect).
- Run
git commit -S .... The first time you'll be prompted for your GPG passphrase but it will be saved by the agent thereafter.