Open the Powsershell as admin and run the following command:
wsl --installvia MS Store:
via winget:
winget install -e --id Microsoft.WindowsTerminalgit clone https://github.com/sroepges/wsl-ubuntu-setup.git &&
cd wsl-setup &&
bash run.shGenerate a new GPG key pair:
gpg --full-generate-keyPlease select what kind of key you want: [ENTER]
What keysize do you want? [4096]
Key is valid for? [ENTER]
List the long form of the gpg key pair:
gpg --list-secret-keys --keyid-format=longAdd the gpg key pair to your git config:
git config --global user.signingkey GPG-KEY-IDIf you want to automatically sign your commits use:
git config --global commit.gpgSign trueAdd this line to your .zshrc file:
[ -f ~/.zshrc ] && echo 'export GPG_TTY=$(tty)' >> ~/.zshrcgpg --armor --export GPG-KEY-IDNow we add the gpg key pair to github in the browser under your settings page.
If you use WSL in combination with VS-Code, you need to setup the GPG pinentry dialog for Windows.
Install the simple installer of the current GnuPG:
GnuPG - Direct Download Link v.2.4.7
Edit the gpg-agent config so it shows the pinentry dialog in Windows:
nano ~/.gnupg/gpg-agent.confPaste the following inside:
default-cache-ttl 34560000
max-cache-ttl 34560000
pinentry-program "/mnt/c/Program Files (x86)/gnupg/bin/pinentry-basic.exe"Restart the gpg agent:
gpgconf --kill gpg-agent