Skip to content

How to create your GPG key, import it and sign your commits.

Notifications You must be signed in to change notification settings

Guilospanck/how-to-gpg-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

how-to-gpg-github

How to create your GPG key, import it and sign your commits.

Generate your GPG keys

You can easily generate your GPG keys using the gpg bundle. It'll all depend on the type of system you're working on. For MacOS, download GPG Suite and generate your keys following the steps. Choose at least 4096 bytes and RSA.

After that, run the following command and copy the fingerprint of your public key.

gpg --list-secret-keys --keyid-format=long

Then, add it to your .gitconfig global:

git config --global user.signingKey {fingerprint}

To sign all your commits automatically (and not rely on -S):

git config --global commit.gpgsign true 

Using GPG

  • Search for keys from other people:
gpg --search-keys <email>
  • Get your complete public key:
gpg --armor --export <fingerprint> 
  • Get GPG key from another GitHub user:
curl https://api.github.com/users/Guilospanck/gpg_keys | jq ".[0].raw_key" -r | gpg --import 
  • Decrypt file
gpg --decrypt hello.go.gpg > hello.go

About

How to create your GPG key, import it and sign your commits.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published