Quick and easy way to setup signed GitHub commits on MacOS
-
Install
gpg
using Homebrew:brew install gpg
. -
Follow the GitHub guide to generate a new gpg key.
-
Add the gpg key to your GitHub account.
-
Get around this issue by doing the following
echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile
-
Reload
.bash_profile
by runningsource ~/.bash_profile
-
Test that gpg works through
echo "test" | gpg --clearsign
-
(Optional) If you want to enable signing on every commit
git config --global commit.gpgsign true
-
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"