我在配置 Visual Studio 2022 以使用 SSH 或 GPG 密钥签署 GitHub 的 Git 提交时遇到问题。
我尝试使用以下命令设置 GPG 签名:
git config --global user.signingkey 3AA5C34371567BD2
git config --global commit.gpgsign true
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试在 Visual Studio 中进行提交时。
我收到以下错误:
Your Git hook is not supported. This is probably because the first line is not "#!/bin/sh".
Run Code Online (Sandbox Code Playgroud)
我检查了目录中的所有文件.git/hooks,它们都#!/bin/sh作为第一行。
如果我不设置git config --global commit.gpgsign true,提交会通过,但在 GitHub 上它被标记为未经验证。
如何正确配置 Visual Studio 以使用 SSH 或 GPG 密钥签署 GitHub 的 Git 提交?任何帮助将不胜感激。
更新:
我找到了在 Visual Studio 2022 中使用 SSH …