Web GUI的GitLab CE克隆项目:致命:无法访问...无法解析主机...因为密码有字符“@”

时间:2016-12-02 04:14:05

标签: git gitlab

我使用GitLab CE。 我通过导入URL初始化一个新的仓库:

https://username:password@gitlab.company.com/group/project.git

在我的密码中有一个特殊字符@。然后错误:

Cloning into bare repository '/var/opt/gitlab/git-data/repositories/vydn/myzip.git'...
fatal: unable to access 'https://username:p@ssword@gitlab.company.com/group/project.git': Couldn't resolve host 'ssword@gitlab.company.com/group/project.git'

如何使用密码在此上下文中具有字符@

2 个答案:

答案 0 :(得分:1)

  • 单独发送username & password

    https://github.com/foobar/SparkDataSystem --username <user> --password <pass>
    
  • 或者,您可以保存username&amp; password减少必须输入用户名/密码的时间

    $ git config credential.helper store
    $ git push http://example.com/repo.git
    Username: <type your username>
    Password: <type your password>
    
    [several days later]
    $ git push http://example.com/repo.git
    [your credentials are used automatically]
    

    See more

答案 1 :(得分:1)

正如GitLab CE issue 7986

中所述
  

根据RFC 3986@是一个特殊字符,需要像这样编码:

https://xxxx:yyyy%40zzzz@mygit.mycompany.com/hello/
                 ^^^
                  |_ instead of '@'