为VS2022 git添加GPG签名

发布于 2023-11-16  137 次阅读


利用git生成GPG Key后,可以在git bash中全局设置GPG签名(VS2022依旧遵循git全局设定):

git config --global user.signingkey 你的GPG Key
git config --global commit.gpgsign true

现在git commit将会带上你的GPG签名,但是VS2022可能会报错“Your Git hook is not supported”,这是vs2022自己的gitconfig没有配置gpg签名程序所在位置导致的

需要额外进行下面操作:

git config --global gpg.program "C:\Program Files\Git\usr\bin\gpg.exe"

请自行将”C:\Program Files\“替换为你安装Git的目录

至此,你的vs2022 git commit将会带上GPG签名


世界上本没有博客,直到有了程序员