Skip to content

Instantly share code, notes, and snippets.

@h3ssan
Created March 9, 2024 10:58
Show Gist options
  • Save h3ssan/a81042a16639f89ffc8cf2252836bfe3 to your computer and use it in GitHub Desktop.
Save h3ssan/a81042a16639f89ffc8cf2252836bfe3 to your computer and use it in GitHub Desktop.
GitHub sign commits via SSH not GPG

Overview

No overview provided yet.

Steps

git config --global gpg.format ssh
  • and then:
git config --global user.signingKey /path/to/ssh/key

Replace the /path/to/ssh/key to the full path of your SSH key such as /home/$USER/.ssh/id_rsa.pem

  • and then:
git config --global commit.gpgSign true

This command will sign at the commit level.

Without this step, you will need to use -S flag with git commit, as follows git commit -S -m "msg"


Happy Commiting

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