How can I use git commits signing in VS Code?

A pull request was recently merged and will be available in the next release of VS Code (August 2017 / 1.16). Alternatively, it is already available in insiders builds.

When available it can be enabled by adding the following to user or workspace settings (file > preferences > settings)

git.enableCommitSigning: true

Prerequisite: Having git setup to sign commits. Instructions can be found here - https://help.github.com/articles/signing-commits-using-gpg/

To set all commits for a repository to be signed by default, in Git versions 2.0.0 and above, run git config commit.gpgsign true. To set all commits in any local repository on your computer to be signed by default, run git config --global commit.gpgsign true.

To store your GPG key passphrase so you don't have to enter it every time you sign a commit, we recommend using the following tools:

For Mac users, the GPG Suite allows you to store your GPG key passphrase in the Mac OS Keychain. For Windows users, the Gpg4win integrates with other Windows tools. You can also manually configure gpg-agent to save your GPG key passphrase, but this doesn't integrate with Mac OS Keychain like ssh-agent and requires more setup.


I meet the same problem.

enter image description here

I can't solved this problem now.

But I know Vscode needs to execute export GPG_TTY=$(tty) before executing git commit

If you can add GPG_TTY=$(tty) to the configuration file(like .bashrc) of the terminal called by vscode, you will solve the problem.

More then see: https://gist.github.com/repodevs/a18c7bb42b2ab293155aca889d447f1b