See technomancy/leiningen#1349 and technomancy/leiningen#615
add use-agent
at then end of ~/.gnupg/gpg.conf
start the gpg-agent
gpg-agent --daemon
Then copy paste the output eg.
GPG_AGENT_INFO=/tmp/gpg-gobqoD/S.gpg-agent:10545:1; export GPG_AGENT_INFO;
Decrypt eagerly to type the passphrase and store it in the agent
gpg --quiet --batch --decrypt ~/.lein/credentials.clj.gpg
eval $(gpg-agent --daemon)
Starting gpg-agent automatically from console machine Shell agnostic
Add the lines below to ~/.profile. Any POSIX-confirming shell should include this file.
# Invoke GnuPG-Agent the first time we login.
# Does `~/.gpg-agent-info' exist and points to gpg-agent process accepting signals?
if test -f $HOME/.gpg-agent-info && \
kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info | cut -c 16-`
else
# No, gpg-agent not available; start gpg-agent
eval `gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info`
fi
export GPG_TTY=`tty`
export GPG_AGENT_INFO