- Gen key
$ gpg --full-gen-key
- List
$ gpg --list-keys
- Export pub key
$ gpg --armor --export {key_id}
- Then add pub key to remote
- Permission ensure
$ sudo chmod 600 ~/.gnupg/*
$ sudo chmod 700 ~/.gnupg
- Run this in console & also add in
.bashrc
or.zshrc
$ export GPG_TTY=$(tty)
- Git
$ gpg --list-secret-keys --keyid-format=long
- Specify key
$ git config commit.gpgSign true
$ git config user.signingKey {key_id}
- Opt config
$ git config --global commit.gpgSign true