Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置。
以下以使用码云为例说明ssh配置步骤:
1. 注册码云账号,地址: https://gitee.com/
2. 在git官网下载对应版本的git 并按提示安装;
3.安装成功后打开git Bash 设置用户名和邮箱
git config --global user.name "YourName"
git config --global user.email "email@example.com"
4.生成SSH Key
在git Bash 中输入ssh-keygen -t rsa -C "email@example.com",连按三次enter键,会看到生成了 一个id_rsa.pub文件
5.登录码云并添加密钥
在提示的文件目录下打开id_rsa.pub文件(或在git Bash中执行 cat id_rsa.pub命令)复制全部内容到码云添加密钥,
微信扫码关注DEMO程序园公众号