如何配置 Visual Studio 2022 以使用 SSH 或 GPG 密钥为 GitHub 签署 Git 提交?

问题描述 投票:0回答:0

我在配置 Visual Studio 2022 以使用 SSH 或 GPG 密钥为 GitHub 签署 Git 提交时遇到问题。

我尝试使用以下命令设置 GPG 签名:

git config --global user.signingkey 3AA5C34371567BD2
git config --global commit.gpgsign true

但是,当我尝试在 Visual Studio 中进行提交时。

我收到以下错误:

Your Git hook is not supported. This is probably because the first line is not "#!/bin/sh".

我检查了

.git/hooks
目录下的所有文件,它们的第一行都是
#!/bin/sh

如果我不设置

git config --global commit.gpgsign true
,提交会通过但在 GitHub 上它被标记为未验证。

如何正确配置 Visual Studio 以使用 SSH 或 GPG 密钥为 GitHub 签署 Git 提交?任何帮助将不胜感激。

git visual-studio github
© www.soinside.com 2019 - 2024. All rights reserved.