7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WindowsにてVisual Studio Codeからcommitするときにgpg署名する

Posted at

はじめに

ながらくWindowsにてVisual Studio Codeからcommitするときにgpg署名するのは無理だと思っていました。

というのはなぜか

Add support for signing commits with GPG · Issue #5065 · Microsoft/vscode#issuecomment-207960831

echo 'no-tty' >> ~/.gnupg/gpg.conf

する方法がうまく行かなかったからです。

前提

  • Windowsを使用
  • Visual Studio Codeがインストールされている
  • git for Windowsがインストールされている
  • git for Windowsでgpg署名付きcommitができる

gpg署名付きcommitができる状態にない場合は
GitHubで署名されたコミットにバッジが表示されるようになったので設定してみる
を参照してください

手順

git for Windows

git config --global commit.gpgsign true

~/.gnupg/gpg-agent.conf

~/.gnupg/gpg-agent.conf
default-cache-ttl 46000
pinentry-program /usr/bin/pinentry
allow-preset-passphrase

を追記します。

Visual Studio Code

設定ファイルに

{
	"git.enableCommitSigning": true,
}

を追記します

参照

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?