GPGキーを作成する
$ gpg --full-generate-key
GPGキーを一覧表示する
$ gpg --list-secret-keys --keyid-format=long
GPGキーを表示する
$ gpg --armor --export <ID>
-----BEGIN PGP PUBLIC KEY BLOCK----- から -----END PGP PUBLIC KEY BLOCK----- までをコピーして、GitHubの Settings > SSH and GPG keys > GPG keys > New GPG key でインポートする。
gitで設定を行う
$ git config --global gpg.program gpg
$ git config --global user.signingkey <ID>
$ git config --global commitgpgsign true
$ git config --global tag.gpgsign true