下载:
https://mirrors.tuna.tsinghua.edu.cn/github-release/git-for-windows/git/Git%20for%20Windows%202.39.2/
安装
搜索:https://blog.csdn.net/mukes/article/details/115693833
添加 SSH Key
首先,我们先了解一下什么是 SSH?
SSH 是一种网络协议,具备协议级别的认证及会话管理等功能。
另外在架设 SSH 服务方面,任何人都可以轻易地创建安全等级高的服务。相比而言 HTTP 协议则没有上述的特点。
简单来说 SSH 是一种有较高安全性的远程登录方式。SSH Key 就是我们登录的密钥。
没有配置 SSH Key 时,会因权限错误而导致失败:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
通过 SSH 克隆项目其实很简单,我们要在本地先生成一个 SSH Key,然后把这个 Key 添加到 Gitlab 用户设置(User Settings) 中就行了。
这里是引用
- 第一步生成 SSH Key
ssh-keygen -t rsa -C "email@example.com"
email@example.com 是你 Gitlab 的邮箱地址
- 第二步,查看 SSH Key,并复制到 Gitlab
cat ~/.ssh/id_rsa.pub
**SSH Key 应当以 'ssh-rsa' 开头(也有 'ssh-ed25519' 格式)**
- 在 Gitlab 中设置

至此,你就可以通过 SSH Key 克隆项目了。
- 如何生成多个 SSH
假如为 Github 生成一个 SSH,注意要区分文件的 key,避免覆盖之前的文件
ssh-keygen -t rsa -C "<您的 Github 邮箱>"
Generating public/private rsa key pair.
Enter file in which to save the key (~/.ssh/id_rsa): myself_rsa
6万+

被折叠的 条评论
为什么被折叠?



