Clone a repository from GitLab with SSH

  1. Create a SSH key (Git bash is recommended):
    https://docs.gitlab.com/ee/ssh/

    ssh-keygen -o -t rsa -b 4096 -C "[email protected]"
    
    //Copy public key (id_rsa.pub is default name)
    cat ~/.ssh/id_rsa.pub | clip
  2. Login Gitlab and paste SSH key in account page
    https://hk.saowen.com/a/a94e3743e7b0591aca8b3bd6361ee64c6c7ffae1863c205f0f602f77307537d6
  3. Execute clone command:
    git clone ssh://[email protected]:group/repo.git myfoldername
    

    https://git-scm.com/book/zh-tw/v2/Git-%E5%9F%BA%E7%A4%8E-%E5%8F%96%E5%BE%97%E4%B8%80%E5%80%8B-Git-%E5%80%89%E5%84%B2

  4. Then you can create a new repo in Source Tree or Github Desktop

Reference:

  1. https://yehchitsai.gitbooks.io/linux-usage/content/use_gitlab.html