1、安装Git (略)
2、生成不同平台的ssh-key
秘钥一:duoduo (阿里云codeup)
* 1、执行命令
> ssh-keygen -t ed25519 -C "wdduoduo"
* 2、输入文件路径(需要区分每个秘钥保存的文件名:Enter file in which to save the key (/c/Users/dell/.ssh/id_ed25519):)
> /c/Users/dell/.ssh/id_ed25519_duoduo
* 3、输入秘钥文件的密码(默认不填,直接回车两次跳过)
>
>
>最终公钥会保存到C盘的 c/Users/dell/.ssh/id_ed25519_duoduo.pub 中
>私钥会保存到 c/Users/dell/.ssh/id_ed25519_duoduo 中
秘钥二:github (Github)
```shell
* 1、执行命令
> ssh-keygen -t ed25519 -C "github"
* 2、输入文件路径(需要区分每个秘钥保存的文件名:Enter file in which to save the key (/c/Users/dell/.ssh/id_ed25519):)
> /c/Users/dell/.ssh/id_ed25519_github
* 3、输入秘钥文件的密码(默认不填,直接回车两次跳过)
>
>
>最终公钥会保存到C盘的 c/Users/dell/.ssh/id_ed25519_github.pub 中
>私钥会保存到 c/Users/dell/.ssh/id_ed25519_github 中
3、配置ssh-key公钥到对应的平台
我配置的是阿里云codeup 和 github 的平台
1、用记事本打开 c/Users/dell/.ssh/id_ed25519_duoduo.pub
文件,复制里面所有的内容
2、打开阿里云的codeup主页,进入个人设置
注:github 和上面的配置一样,把 c/Users/dell/.ssh/id_ed25519_github.pub
文件里的内容配置好就行
4、通过用户名克隆(对应平台)项目
比如,我(在阿里云codeup仓库)的项目地址是:
git@codeup.aliyun.com:652532221273ae64093fdcfsdfttbc/server/open-account.git
那么,我拉取代码的命令就是
git clone git@duoduo:652532221273ae64093fdcfsdfttbc/server/open-account.git
5、IDEA修改 remote 设置
点击菜单栏:Git > manage remotes