GitLab CE clone project by web GUI: fatal: unable

2019-02-20 11:44发布

I use GitLab CE. I init a new repo by import URL:

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

In my password have a special character @. Then error:

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'

How to use password has character @ in this context?

标签: git gitlab
2条回答
一纸荒年 Trace。
2楼-- · 2019-02-20 11:59

As mentioned in GitLab CE issue 7986

As per RFC 3986, @ is a special character and needs to be encoded like this:

https://xxxx:yyyy%40zzzz@mygit.mycompany.com/hello/
                 ^^^
                  |_ instead of '@'
查看更多
Ridiculous、
3楼-- · 2019-02-20 12:04
  • Send username & password separately

    https://github.com/foobar/SparkDataSystem --username <user> --password <pass>
    
  • Or, you can save your username & password to reduce the number of time you must type your username/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

查看更多
登录 后发表回答