第一次使用mac系統(tǒng)的電腦配置SSH密鑰,公司的項目都放在gitlab上托管,所以想從gitlab上clone下來項目的話就要配置SSH Key,然后才能使用Clone with SSH拉取文件。
結(jié)果輸入git clone <git@gitlab.xxx>
之后
出現(xiàn)了以下提示:
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 "your_email@youremail.com"
1.輸入上述命令后,我們這使用默認的一路回車就行。成功的話會在~/下生成.ssh文件夾,進去,打開id_rsa.pub,復(fù)制里面的key。
2.回到gitlab上,點擊右上角頭像進入 preferences,左邊選擇SSH Keys,Add SSH Key,title隨便填,粘貼在你電腦上生成的key。文章來源:http://www.zghlxwxcb.cn/news/detail-529527.html
3.配置完成后直接git中輸入git clone xxx就可以像上面一樣拉取了,注意一定要輸入yes, 輸入yes之后,.ssh文件下就會自動添加進來known_hosts文件了。文章來源地址http://www.zghlxwxcb.cn/news/detail-529527.html
到了這里,關(guān)于【Mac系統(tǒng)下配置gitlab的SSH Key密鑰時git clone無法拉取】的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!