Github Signing Commits

Managing your computer keys

This steps worked on Ubuntu Linux

Listing existing keys

gpg --list-secret-keys
gpg --list-secret-keys --keyid-format LONG

Generating a key

gpg --full-generate-key

Making Git use the key to sign the commits

git config --global user.signingkey [THE KEY ID]
git commit -S -m 'Your commit message'

Make Git automatically sign all the commits

git config --global commit.gpgsign true

To disable Signing commits for a specific Repo

git config commit.gpgsign false

Adding your key to Github

Show your key public block using this command

gpg --armor --export [THE KEY ID]

You need to tell Github about your key, by adding it to the list of your account keys from this page