Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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"

@cedricwalter

This comment has been minimized.

@maicol07

This comment has been minimized.

Copy link

commented Jun 29, 2018

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
You can’t perform that action at this time.