Setting up Git for Windows and Gpg4win
This article will help you set up your development environment with git and gpg to sign your commits and manage your gpg keys for different personas.
This article will not guide you step by step to install the programms needed, explain how gpg works nor will it tell you why you should sign your git commits.
- You are on a Windows (7+) system
- You have installed [msysgit]
- You have installed Gpg4win
- You may have already generated your gpg keys with msysgit's gpg or with Gpg4win
Open %UserProfile%/AppData/Roaming/gnupg/gpg.conf
and add the following
lines:
personal-digest-preferences SHA256
cert-digest-algo SHA256
The create your keys either with GPA, Kleopatra or on the command line.
Download and extract iconv.dll
to /path/to/Git/bin
Open /path/to/Git/etc/profile
and change the following line:
export GNUPGHOME=~/.gnupg
to
export GNUPGHOME="/c/Users/UserName/AppData/Roaming/gnupg"
Open Git bash and enter the following:
$> gpg --list-key
You should now see your keys
If you have generated your keys first with msysgit's gpg (on Git bash)
then copy the files under
%UserProfile%/.gnupg
to %UserProfile%/AppData/Roaming/gnupg
Export and import your public and secret keys between the two locations, otherwise.
Git Bash uses GPG 1.4.x and Gpg4win uses 2.0.x
Managing multiple keys in a git repository
by mflatischler under CC-BY-SA
The path is correct for me and no problems so far, thanks