0


【Mac系统下配置gitlab的SSH Key密钥时git clone无法拉取】

第一次使用mac系统的电脑配置SSH密钥,公司的项目都放在gitlab上托管,所以想从gitlab上clone下来项目的话就要配置SSH Key,然后才能使用Clone with SSH拉取文件。
结果输入

git clone <[email protected]>

之后
出现了以下提示:

The authenticity of host'gitlab.qwq360.com (10.0.158.52)' can't be established.
ED25519 key fingerprint is SHA256:S+V22OTBMw7eD+9/pFcpH2SlFdOJhjAdG3HDXxqbTEQ.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?

此时一定要输入yes才能顺利clone,千万记得!!!,不要默认为空,否则clone不下来

The authenticity of host'gitlab.insta360.com (10.0.158.52)' can't be established.
ED25519 key fingerprint is SHA256:S+V22OTBMw7eD+9/pFcpH2SlFdOJhjAdG3HDXxqbTEQ.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitlab.insta360.com' (ED25519) to the list of known hosts.
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 64010(delta 0), reused 0(delta 0), pack-reused 64000
Receiving objects: 100% (64010/64010), 753.75 MiB |10.93 MiB/s, done.
Resolving deltas: 100% (29514/29514), done.
Updating files: 100% (4459/4459), done.

配置SSH Key的步骤如下:

$ ssh-keygen -t rsa -C "[email protected]"

1.输入上述命令后,我们这使用默认的一路回车就行。成功的话会在~/下生成.ssh文件夹,进去,打开id_rsa.pub,复制里面的key。

2.回到gitlab上,点击右上角头像进入 preferences,左边选择SSH Keys,Add SSH Key,title随便填,粘贴在你电脑上生成的key。

3.配置完成后直接git中输入git clone xxx就可以像上面一样拉取了,注意一定要输入yes, 输入yes之后,.ssh文件下就会自动添加进来known_hosts文件了。

标签: ssh macos gitlab

本文转载自: https://blog.csdn.net/Asabc12345/article/details/126623828
版权归原作者 滑了丝的螺丝钉 所有, 如有侵权,请联系我们删除。

“【Mac系统下配置gitlab的SSH Key密钥时git clone无法拉取】”的评论:

还没有评论