How to config SSH for gitlab?

前端 未结 3 608
悲&欢浪女
悲&欢浪女 2021-02-04 07:17

In my experience of Github, I tought that I need to clone a repository with my user like user@gitlabhost.com. But when I try this, then it does not recognize my pas

3条回答
  •  长发绾君心
    2021-02-04 08:01

    If you followed Installation Instructions of gitlab, then you must have installed it on an linux box under the user named git. Typically in a folder like this

    /home/git/gitlab 
    

    Hence you should use git@gitlabhost.com

    I am not sure what you mean by "configuring SSH". But since each user is expected to use her own keypair, there should be no problem in accessing gitlab managed repo's using normal git commands. Both the following should work

    git clone ssh://git@gitlabhost.com/group/repo.git
    git clone git@gitlabhost.com:group/repo.git
    

    Each user must have set their own git identity (on their local machines) using

    git config --global user.name "elitmus"
    git config --global user.email "abc@gmail.com"
    

    so that git can uniquely identify each user.

提交回复
热议问题