Skip to content

Instantly share code, notes, and snippets.

@kaipm
Last active September 4, 2023 12:44
Show Gist options
  • Save kaipm/8ad3967bf41996b98d2e3e825c12dfd1 to your computer and use it in GitHub Desktop.
Save kaipm/8ad3967bf41996b98d2e3e825c12dfd1 to your computer and use it in GitHub Desktop.

Signing commits

You can sign commits via GPG. Since 2022 you can also sign with SSH.

Signing with SSH

  1. Your git email must match GitHub (either real email, or anonymous one):

    git config --global user.email "[email protected]"
    
  2. Create or reuse an SSH key for signing

    GitHub > User Menu > Settings > SSH and GPG keys

    If you authenticate via SSH, you can also re-upload the same key for signing again

  3. Setup your local git

    git config --global gpg.format ssh
    git config --global commit.gpgSign true
    git config --global user.signingKey "path-to-private-key"
    

Change SSH private key password

Run the following command. You must supply the old password, and enter a new one.

ssh-keygen -p -f /path/to/private_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment