Skip to content

Instantly share code, notes, and snippets.

@iamajvillalobos
Created March 19, 2018 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamajvillalobos/b9c0ef5dd433e0e08af65ed4a6efc932 to your computer and use it in GitHub Desktop.
Save iamajvillalobos/b9c0ef5dd433e0e08af65ed4a6efc932 to your computer and use it in GitHub Desktop.
How to signed your commits in GitHub using gpg
  1. Open https://github.com/settings/gpg/new in a new tab
  2. Install gpg-suite brew cask install gpg-suite
  3. Generate your gpg key gpg --full-generate-key NOTE: Enter 4096 for key size
  4. View your gpg keys with gpg --list-secret-keys --keyid-format Sample:
gpg --list-secret-keys --keyid-format LONG
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid                          Hubot 
ssb   4096R/42B317FD4BA89E7A 2016-03-10
  1. Copy 3AA5C34371567BD2 in this case, this will be your GPG ID
  2. Export your GPG key gpg --armor --export GPG_ID
  3. Copy your key to page in Step 1. gpg --armor --export GPG_ID | pbcopy (this will copy your key in clipboard)
  4. Paste it here https://github.com/settings/gpg/new
  5. On your gitconfig file add these lines:
[user]
  signingkey = GPG_ID
[commit]
  gpgsign = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment