Screw configuring GPG to sign git commits, do it with your same SSH key like this

GPG gives a lot of shit on macos for some reason.

It’s best to just add the same SSH authentication key you have on github as a “Signing Key” in your github account signing configuration.

Go to Settings > SSH and GPG Keys

You can then configure your github client and repo to use that key to sign in two ways.

  1. On the command line
$ git config [--global] gpg.format ssh
$ git config [--global] user.signingkey ~/.ssh/id_rsa.pub
$ git config [--global] commit.gpgsign true
  1. On the repo’s .git/config file
[user]
        name = gubatron
        email = gubatron@gmail.com
        signingkey = /Users/gubatron/.ssh/id_rsa.pub
[github]
        user = gubatron
[gpg]
        format = ssh
[commit]
        gpgsign = true

Leave a Reply

Your email address will not be published. Required fields are marked *