克隆 gitlab 的项目

  • 一开始尝试 clone —> Clone with HTTPS

    • 但是报错,The authenticity of host 'gitlab.com (172.65.251.78)' can't be established. ED25519 key fingerprint
    • 是在告诉你,你的系统无法验证 gitlab.com 服务器的身份,因为它之前没有见过这个服务器的公钥指纹
  • 我这里改用 SSH 操作

    • $ cat ~/.ssh/id_rsa.pub 看已有的密钥

    • $ ssh-keygen -t rsa -C "自定义备注" 新建密钥

    • 回车、y、回车:

      image-20240105165741912

    • 出现图形后,到 C:\Users\dell.ssh 里的 id_rsa.pub 就是密钥,打开复制,粘贴到 GitLab 中(登录 GitLab 官网后,点击头像打开 Settings,左侧选中 SSH Keys,)

    image-20240105170101766

    • 然后继续输入 $ ssh -T git@gitlab.com,可能会弹出 Are you sure you want to continue connecting (yes/no/[fingerprint])?,输入 yes 即可完成连接

    • 然后就可以复制项目的 SSH 地址 clone 了

posted @ 2024-02-21 23:53  朱呀朱~  阅读(109)  评论(0编辑  收藏  举报