GitLab git user password

前端 未结 19 1336
借酒劲吻你
借酒劲吻你 2020-12-02 22:10

I have just installed GitLab.

I created a project called project-x.

I have created few users and assigned it to the project.

Now I tried to clone:

19条回答
  •  青春惊慌失措
    2020-12-02 22:28

    This can happen if the host has a '-' in its name. (Even though this is legal according to RFC 952.) (Tested using Git Bash under Windows 10 using git 2.13.2.)

    ssh prompts me for a password for any host that happens to have a '-' in its name. This would seem to be purely a problem with ssh configuration file parsing because adding an alias to ~/.ssh/config (and using that alias in my git remote urls) resolved the problem.

    In other words try putting something like the following in your C:/Users/{username}/.ssh/config

    Host {a}
        User git
        Hostname {a-b.domain}
        IdentityFile C:/Users/{username}/.ssh/id_rsa
    

    and where you have a remote of the form

    origin  git@a-b.domain:repo-name.git
    

    change the url to use the following the form

    git remote set-url origin git@a:repo-name.git
    

提交回复
热议问题