Generate a new GPG key (https://help.github.com/articles/generating-a-new-gpg-key/)
$ gpg2 --full-gen-key
$ gpg2 --list-keys --keyid-format LONG
$ gpg2 --armor --export ABC123DEF
Add the obtained key to your account.
$ git config --global commit.gpgsign true
$ git config --global gpg.program gpg2
$ git config --global user.signingkey ABC123DEF
Note: ensure that the commiters' email march the email in the key. Set the email if needed
$ git config user.email [email protected]