Skip to content

Instantly share code, notes, and snippets.

@diegofigmedeiros
Forked from xavierfoucrier/gpg-signing.md
Created May 28, 2022 19:15
Show Gist options
  • Select an option

  • Save diegofigmedeiros/01fee18278e01bee3906951061e7e964 to your computer and use it in GitHub Desktop.

Select an option

Save diegofigmedeiros/01fee18278e01bee3906951061e7e964 to your computer and use it in GitHub Desktop.
GPG signing with Git and Github Desktop

Hi Windows users,

I can now signed my commits on Github using Git 2.18.0 and Github Desktop 1.6.1.

Here is what I have done:

  • add C:\Program Files\Git\usr\bin to the environment PATH (depends on your Git install) to allow Windows to locate the gpg.exe program
  • generate a GPG key and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key (if you don't want to type a passphrase on every commit, you need to press "Enter" when the console will prompt you to type a passphrase)
  • configure the Git .gitconfig file properly:
[user]
  name = Xavier Foucrier
  email = YOUR_GITHUB_EMAIL
  signingkey = YOUR_SIGNING_KEY
[gpg]
  program = gpg.exe
[commit]
  gpgsign = true

this file is located in the %USERPROFILE% directory, ie: C:\Users\Xavier\.gitconfig

YOUR_SIGNING_KEY should follow the GPG key ID convention, like this example: https://help.github.com/articles/telling-git-about-your-signing-key/#telling-git-about-your-gpg-key-1.

That's all folks! 🎉

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