run once to create trustdb
gpg --list-secret-keys --keyid-format LONG
gpg --import public.asc
gpg --import private.asc
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 "[email protected]"
git config --global user.name "Cédric Walter"
git config --global gpg.program "C:/Program Files (x86)/GnuPG/bin/gpg.exe"
add to your .bashrc
export GPGKEY=DF52ADDAC81A08A6
then you can commit
git cis -m "add new project"
follow then https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Backing_up_and_restoring_your_keypair