gpt4 book ai didi

visual-studio-code - 如何使用 git commits 登录 VS Code?

转载 作者:行者123 更新时间:2023-12-03 21:43:23 35 4
gpt4 key购买 nike

我们在存储库中使用 gpg 签名签名,但是当我尝试在 vscode 中提交更改时,出现此错误:

gpg: cannot open tty `/dev/tty': No such device or address
error: gpg failed to sign the data

如果我在 vscode 的终端中执行“git commit”,一切正常。所以我猜这个问题不在 git/gpg/gpg-agent 中。有没有办法让 vscode 处理这个问题?

最佳答案

一个 pull request最近合并,将在 VS Code 的下一版本(2017 年 8 月/1.16)中提供。或者,它已经在 Insiders 版本中可用。

如果可用,可以通过将以下内容添加到用户或工作区设置来启用它(文件 > 首选项 > 设置)

git.enableCommitSigning: true

先决条件:有 git setup 来签署提交。说明可以在这里找到 -
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.

关于visual-studio-code - 如何使用 git commits 登录 VS Code?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45730815/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com