配置 Git 使用 SSH 签名和验证

ssh-keygen -t ed25519 -C "你的邮箱地址"

先用该命令生成一个新的 ssh 密钥

然后配置 git

git config --global user.name "你的用户名"

git config --global user.email "你的邮箱地址"

git config --global commit.gpgsign true

git config --global gpg.format ssh

git config --global user.signingkey <你的 ssh 私钥 path>(公钥 path 也行)


配置 Git 使用 SSH 签名和验证
https://nekoside.com/archives/pei-zhi-git-shi-yong-ssh-qian-ming-he-yan-zheng
作者
nekoside
发布于
2026年02月03日
更新于
2026年02月03日
许可协议