Skip to content

Instantly share code, notes, and snippets.

@cedricwalter
Last active August 2, 2020 13:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedricwalter/fd56b9c05b34514790bc09d3008bea0e to your computer and use it in GitHub Desktop.
Save cedricwalter/fd56b9c05b34514790bc09d3008bea0e to your computer and use it in GitHub Desktop.
using GPG to sign your GIT commit

Windows

run once to create trustdb

gpg --list-secret-keys --keyid-format LONG

Common

import

gpg --import public.asc
gpg --import private.asc

tell GIT to use your GPG keys

From the list of GPG keys, copy the GPG key ID you'd like to use. In this example, the GPG key ID is DF52ADDAC81A08A6:

git config --global commit.gpgsign true
git config --global user.signingkey DF52ADDAC81A08A6
git config --global alias.logs "log --show-signature"
git config --global alias.cis "commit -S"
git config --global user.email "cedric.walter@gmail.com"
git config --global user.name "Cédric Walter"
git config --global gpg.program "C:/Program Files (x86)/GnuPG/bin/gpg.exe"

Linux

add to your .bashrc

export GPGKEY=DF52ADDAC81A08A6

Using

then you can commit

git cis -m "add new project"

@maicol07
Copy link

Hi,
this doesn't work in IntelliJ PyCharm could you fix it?
Thanks

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