GIT - autosign commits with GPG key

less than 1 minute read


This is a HowTo for setting up git for signing your commits auto-magic-ly with your GPG key.


  • having a GPG-Key

Do it

get GPG key ID

gpg --list-keys

set gpg programm for signing (optional)

git config --global gpg.program gpg2

set gpg key for signing

git config --global user.signingkey <GPG-KEY-ID>

git config --global user.signingkey F2C7AB2

configure autosign

git config –-global commit.gpgsign true     # global - for all repos
git config commit.gpgsign true     # local - for the current repos