Git Committing GPG signing commits


  1. Determine your key ID

    gpg --list-secret-keys --keyid-format LONG
    sec   2048R/YOUR-16-DIGIT-KEY-ID YYYY-MM-DD [expires: YYYY-MM-DD]

    Your ID is a alphanumeric 16-digit code following the first forward-slash.

  2. Define your key ID in your git config

    git config --global user.signingkey YOUR-16-DIGIT-KEY-ID
  3. As of version 1.7.9, git commit accepts the -S option to attach a signature to your commits. Using this option will prompt for your GPG passphrase and will add your signature to the commit log.

    git commit -S -m "Your commit message"