Last active
September 25, 2025 11:32
-
-
Save matthiasr/473072eeffe449459e3ccd0f5192afc7 to your computer and use it in GitHub Desktop.
Revisions
-
matthiasr revised this gist
Feb 10, 2023 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,12 @@ Notably, when using a TTY-based pinentry, signing in Visual Studio Code does not 1. Install [Gpg4Win](https://www.gpg4win.org/): `winget install -e GnuPG.Gpg4win` or download and install manually 2. Start Kleopatra and generate or import keys 3. Insert links to `gpg.exe` inside of WSL: ``` sudo ln -s /mnt/c/Program\ Files\ \(x86\)/GnuPG/bin/gpg.exe /usr/local/bin/gpg sudo ln -s gpg /usr/local/bin/gpg2 ``` 5. That's it! Git and other GPG commands will now use the GPG installed in Windows, which has access to the GPG agent from Gpg4Win, and uses its graphical pinentry for passphrases. # Troubleshooting -
matthiasr revised this gist
Feb 3, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Notably, when using a TTY-based pinentry, signing in Visual Studio Code does not # Troubleshooting This `gpg` should take precedence over any gpg installed on the system. Verify this with `command -v gpg`. If this is not `/usr/local/bin/gpg`, check `$PATH` for the order of precedence on your system, and create the link in a directory that precedes (is left of) `/usr/bin` or wherever the package manager installed GPG. # See also -
matthiasr revised this gist
Feb 3, 2023 . No changes.There are no files selected for viewing
-
matthiasr created this gist
Feb 3, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # Problem statement Signing with GPG in Windows System for Linux (WSL2) does not work smoothly out of the box. Notably, when using a TTY-based pinentry, signing in Visual Studio Code does not work at all. # Solution 1. Install [Gpg4Win](https://www.gpg4win.org/): `winget install -e GnuPG.Gpg4win` or download and install manually 2. Start Kleopatra and generate or import keys 3. Insert a link to `gpg.exe` inside of WSL: `sudo ln -s /mnt/c/Program\ Files\ \(x86\)/GnuPG/bin/gpg.exe /usr/local/bin/gpg` 4. That's it! Git and other GPG commands will now use the GPG installed in Windows, which has access to the GPG agent from Gpg4Win, and uses its graphical pinentry for passphrases. # Troubleshooting This `gpg` should` take precedence over any gpg installed on the system. Verify this with `command -v gpg`. If this is not `/usr/local/bin/gpg`, check `$PATH` for the order of precedence on your system, and create the link in a directory that precedes (is left of) `/usr/bin` or wherever the package manager installed GPG. # See also * [wsl2-gpg-agent](https://github.com/AkashiSN/wsl2-gpg-agent) * [SSH access to 1Password](https://dev.to/d4vsanchez/use-1password-ssh-agent-in-wsl-2j6m)