git配置SSH密钥

1.生成新的 SSH 密钥

1
ssh-keygen -t ed25519 -C "your_email@example.com"

2.测试 SSH 连接

​ 将 your_email@example.com 替换为你在 Git 服务提供商(如 GitHub)上注册的邮箱地址。

执行命令后,会提示你选择密钥的保存位置和设置密码(密码可以为空)。一般情况下,直接按回车键使用默认设置即可。

1
ssh -T git@github.com