1. Install gpg using Homebrew: brew install gpg.

  2. Follow the GitHub guide to generate a new gpg key.

  3. Add the gpg key to your GitHub account.

  4. Get around this issue by doing the following echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile

  5. Reload .bash_profile by running source ~/.bash_profile

  6. Test that gpg works through echo "test" | gpg --clearsign

  7. (Optional) If you want to enable signing on every commit git config --global commit.gpgsign true

  8. Test a commit. You need to provide the -S flag if you didn't do step 7: git commit -S -m "This is a signed commit"