在gpg安装目录(mac的是~/.gnup)下建立两个配置文件: 1、gpg.conf use-agent pinentry-mode loopback 2、gpg-agent.conf allow-loopback-pinentry