码云配置git SSH密钥

1.在git官网下载对应版本的git 并按提示安装;

2.安装成功后打开git Bash 设置用户名和邮箱

    git config --global user.name "YourName" 

    git config --global user.email "[email protected]"

3.生成SSH Key

   在git Bash 中输入ssh-keygen -t rsa -C "[email protected]",连按三次enter键,会看到生成了 一个id_rsa.pub文件

4.登录码云并添加密钥

在提示的文件目录下打开id_rsa.pub文件(或在git Bash中执行 cat id_rsa.pub命令)复制全部内容到码云添加密钥,

5.测试是否连接成功

git Bash中输入: ssh -T [email protected], 返回 Welcome to Git@OSC, yourname!则成功


备注:如果两台电脑(公司和私人)都要使用同一个码云账号管理项目,那就在码云里面配置两台电脑分别对应的SSH Key


 

你可能感兴趣的:(码云配置git SSH密钥)