git clone因为含有特殊字符导致失败 Could not resolve host

某git仓库,用户名是userA,密码是pw12*#

git version 1.9.1的机器 上

git clone http://userA:pw12*#@love.3q.com/usera/Fruit.git b

成功

但在git version 2.7.4的机器 上则会失败

$ git clone http://userA:pw12*#@love.3q.com/usera/Fruit.git b
正克隆到 'FreemePrivateNewsPageCn'...
fatal: unable to access 'http://userA:pw12*#@love.3q.com/usera/Fruit.git/': \
Could not resolve host: userA

但转义一下,可行

git clone http://userA:pw12%2a%[email protected]/usera/Fruit.git b

可以成功

猜你喜欢

转载自blog.csdn.net/coraline1991/article/details/120325749