gpg生成
gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
gpg --armor --export 你的密钥ID
添加ssh和gpg到github
# pass
git 配置
# maybe need
git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"
git config --global user.signingkey 3BECCAC113E09805
git config --global commit.gpgsign true
检查
echo "test" | gpg --clearsign
问题
error: gpg failed to sign the data
- 可能是终端屏幕太小,请重新调整大小。
- 可能是未设置终端,请输入
export GPG_TTY=$(tty)
。