Skip to content

Instantly share code, notes, and snippets.

@gubatron
Last active September 18, 2025 01:55
Show Gist options
  • Select an option

  • Save gubatron/a5af61af4230320ce313cd6f77f2b83b to your computer and use it in GitHub Desktop.

Select an option

Save gubatron/a5af61af4230320ce313cd6f77f2b83b to your computer and use it in GitHub Desktop.
Signing github commits with your SSH key

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"

$ git config [--global] gpg.format ssh
$ git config [--global] user.signingkey ~/.ssh/id_rsa.pub
$ git config [--global] commit.gpgsign true

you can also do this manually on the .git/config of your project

[user]
        name = gubatron
        email = [email protected]
        signingkey = /Users/gubatron/.ssh/id_rsa.pub
[github]
        user = gubatron
[gpg]
        format = ssh
[commit]
        gpgsign = true
@generic-pers0n
Copy link

Normally, I'd sign with my GPG key, and I've done this in the past before. However, since the key was on my old laptop and I have yet to retrieve it, I currently don't have the key.

Maybe this'll be the final push across the finish line to retrieve stuff off my old laptop 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment