How to use the GitBash to clone data with ssh (windows 10 environment)

后端 未结 2 1509
萌比男神i
萌比男神i 2021-01-17 02:47

What can I solve this problem?
when I wanted to connect my personal GitLab account, I got an error message like the following picture

### shell script         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-17 03:14

    I have found a great reference but sorry for Mandarin website, however, I can use my way to share how to deal with this issue.

    Step 1:

    ls -al ~/.ssh
    

    Step 2:

    ssh-keygen 
    

    (using enter key for default value) Step 3: To setup config file

    vim /c/Users/Willie/.ssh/config
    

    Host gitlab.com
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/id_rsa

    Step 4:

    git clone git@gitlab.com:/test2.git
    

    Step 5:
    When you finished Step 4
    1.the test2.git file will be download done
    2.you will get the new file(known_hosts) in the ~/.ssh

    PS: I create the id_rsa and id_rsa.ub by myself and I deliver it to the Gitlab server. using both keys to any client-sides(windows and Linux).

提交回复
热议问题