配置 SSH 密钥(一劳永逸,免密码)
1、在新电脑生成 SSH 密钥
打开 Git Bash(Windows)或终端(Mac/Linux),执行:bash运行ssh-keygen -t ed25519 -C "your_email@example.com"
一路回车,默认保存到 ~/.ssh/id_ed25519。
2、将公钥添加到 Codeup
打开公钥文件:
Windows:C:\Users\你的用户名\.ssh\id_ed25519.pub
Mac/Linux:~/.ssh/id_ed25519.pub
复制全部内容 → Codeup → 个人设置 →「SSH 密钥」→「添加 SSH 密钥」,粘贴并保存。
3、用 SSH 地址克隆
回到 Codeup 仓库,复制 SSH 地址(格式:git@codeup.aliyun.com:xxx/xxx.git)
在 VS 或 Git Bash 中执行: git clone git@codeup.aliyun.com:xxx/xxx.git