1 、注册 gitlab 账号。https://about.gitlab.com/ (大部分公司都会有自己独立的git 地址和账号)
2、确保电脑安装git 并切通过邮箱登陆账号。

3、用邮箱登录账号生成 ssh 公钥 命令 ssh-keygen -t rsa -C "youremail@example.com"

生成上面的文件。 并且更改下文件后缀为txt。打开 id_rsa文件,复制ssh 到你的git setting 里面保存
4、在Sourcetree 官网下载 Sourcetree 软件,安装并且注册账号。(网上有免注册的,个人不建议)
https://www.sourcetreeapp.com/
5、安装并登录之后。打开sourcetree ,顶部打开工具 → 选项
选择 OpenSSH 。确定

6、点开工具,选择 添加SSH密钥 ,选择之前生成的 is_rsa 文件 打开。

7、这样就可以链接到git 项目了。直接复制git项目 地址用sourcetree clone保存就可以了。
网友评论