---
title: "Enable GPG-Signed Commits in VSCode"
url: "https://blog.101ta28.com/en/posts/vscode-enable-gpg-signed-commits/"
language: "en"
description: "How to enable GPG-signed commits in VSCode"
---

# Enable GPG-Signed Commits in VSCode

> How to enable GPG-signed commits in VSCode

I wanted to make GPG-signed commits directly in VSCode, so I tweaked the GPG settings in WSL.

When GPG signing is enabled in Git, you might encounter an error like `git =gpg failed to sign the data vscode`.

To resolve this, I set Git for Windows to trigger a GUI for entering the GPG passphrase. Additionally, I configured WSL to call Pinentry, making the process smoother.

```bash
$ vim ~/.gnupg/gpg-agent.conf
# Add the following line:
# pinentry-program "/mnt/c/Program Files (x86)/Gpg4win/bin/pinentry.exe"
# Return to the terminal:
$ gpg-connect-agent reloadagent /bye
```

With this configuration, a passphrase input GUI will appear when making commits in VSCode.
