可参考:
# 1. 生成ssh key 【 注:回车默认配置 】
ssh-keygen -t ed25519 -C "960869719@qq.com"
# windows生成文件在 `C:\Users\zhengqingya\.ssh` 目录下
# id_ed25519:SSH公钥
# id_ed25519.pub:SSH私钥
# 2. 查看生成的公钥
cat ~/.ssh/id_ed25519.pub
# ex:
# ssh-ed25519 xxxxxx 960869719@qq.com
# 3. 将上面公钥拷贝到git页面ssh公钥中保存
# github => https://github.com/settings/ssh/new
# 4. 查看已生成的私钥(本地拉取代码使用)
cat ~/.ssh/id_ed25519
# 5. 测试
ssh -T git@github.com
# Hi zhengqingya! You've successfully authenticated, but GitHub does not provide shell access.
# 拉取代码
git clone git@github.com:zhengqingya/git-test.git