本地连接Gitlab
配置GitLab SSH公钥
1.查看本机是否有SSH Key,在终端输入:
$ cd ~/.ssh
$ ls
id_rsa id_rsa.pub
localhost:Merchant daweikeji$ cd ~/.ssh
localhost:.ssh daweikeji$ ls
id_rsa id_rsa.pub key_backup known_hosts
2.我的这边已经存在SSH Key,如果您那边没有,则需要生成SSH Key,生成方法如下,在终端输入:
ssh-keygen -t rsa -C "您的邮箱@163.com"
3.打开id_rsa.pub文件,复制里面的内容,在终端输入:
$ cat ~/.ssh/id_rsa.pub

image.png
4.登录GitLab账号,点击头像,Setting->SSH Keys,将复制的公钥黏贴到Key
文本框中,title
随便添加就可以了。

image.png
4.验证配置是否成功,在终端输入:
$ ssh -T git@gitlab.com

image.png
本文标题:本地连接Gitlab
本文链接:https://www.haomeiwen.com/subject/opawmqtx.html
网友评论