Skip to main content

Setting up Git commit signing to verify your commits

Signing using GPG

To sign Git commits with GPG, read GitHub's docs on managing signature verification.

To test if you get an error when signing keys, run this:

echo "test" | gpg --clearsign

If you get this error:

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

Then run this:

export GPG_TTY=$(tty)

If you don't want to do that every time, you can add it to your .bash_profile

  1. Type sudo nano ~/.bash_profile into your terminal and press Enter
  2. Paste export GPG_TTY=$(tty)
  3. Press Ctrl+O to initiate writing the file out
  4. Press Enter to write the file out
  5. Press Ctrl+X to close the file

Updating a fork

You can update a fork by adding an "upstream" branch along to your "origin" branch by following the GitHub tutorials.