- 安装 gpg
brew install gnupg
2. 生成密钥
www.ruanyifeng.com/blog/2013/0…
- 上传公钥
将上传的公钥配置到 github 中,是公钥,公开的密钥,不是私钥。
- 配置 git
git config --global gpg.program gpg
git config --global user.signingkey "长密钥 id"
git config --global commit.gpgsign true
- 配置,解决
error: gpg failed to sign the data问题
export GPG_TTY=$(tty)