使用 SSH 方式推送代码无需每次输入密码,更安全便捷。
ssh-keygen -t ed25519 -C "你的邮箱@example.com"
按提示:保存位置直接回车(默认 ~/.ssh/id_ed25519),密码可选。
cat ~/.ssh/id_ed25519.pub
Get-Content ~/.ssh/id_ed25519.pub
公钥格式示例:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... 邮箱
ssh -T git@git.tokenai.biz
成功:Hi there, 用户名! You've successfully authenticated...
git clone git@git.tokenai.biz:用户名/仓库名.git