git clone through ssh

后端 未结 10 2116
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 08:47

I have a project on which I created a git repository:

$ cd myproject  
$ git init  
$ git add .  
$ git commit  

I the wanted to create a b

10条回答
  •  再見小時候
    2020-12-12 09:00

    try this.

    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 meself and I deliver it to the Gitlab server. using both keys to any client-sides(windows and Linux).

提交回复
热议问题