Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imShakil/fc5e54418208d73609b64ad8d30603a8 to your computer and use it in GitHub Desktop.
Save imShakil/fc5e54418208d73609b64ad8d30603a8 to your computer and use it in GitHub Desktop.
How to create gpg key to commit signature verification

To install gnupg

sudo apt-get install gnupg

To Generate gpg key with details

gpg --full-generate-key

TO display text format public key

gpg --armor --export [email-id/key] > gpg.key

cat gpg.key

Add this key into github

Add this key into local git client

$ git config --global user.signingkey [secret-key]
$ git config --global commit.gpgsign true
$ git config --global gpg.program $(which gpg)

To find secret key

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

After then choose the secret key formatted as rsa.../secret key

Commit Signature Verification

git commit -S -m "msg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment