如何在git URL中转义`@`密码 [英] How can I escape `@` of password in git URL

查看:874
本文介绍了如何在git URL中转义`@`密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

借口:

我看到这个:在git代理密码中Escape @ character
但是它是关于 http.proxy param和 p%4055 对我不起作用 url param。

Excuses:
I see this: Escape @ character in git proxy password But It's about http.proxy param, and p%4055 does not work for me about url param.

我的问题:

我使用git 1.7.1版本

我的密码存储库是: p @ 55

我为客户端使用 gitlab 服务器和 centos
.git / config 文件,我是这样的:

My question:
I use git version 1.7.1
My password repository is: p@55
And I use gitlab server, and centos for client.
In .git/config file, i have be like this:

[remote "origin"]
url = http://user:p@55@domain.com:port/repo.git

但是,当我拉它,给我这个错误:

But when I pull it, Gave me this error:

error: Couldn't resolve host '55:domain.com' while accessing ...

我知道escape @ char,但是:

I know about escape @ char, but:

我尝试 p \ @ 55 ,G ave me this error:

I try p\@55, Gave me this error:

fatal: bad config file line 8 in .git/config

我尝试 p%4055 ,给我这个错误:

I try p%4055, Gave me this error:

error: The requested URL returned error: 401 while accessing ...


推荐答案

我只是将git版本从1.7.1升级到2.11.1,这对我有用:

I just upgrade git version from 1.7.1 to 2.11.1 and this worked for me:

url = http://user:p%4055@domain.com:port/repo.git

这篇关于如何在git URL中转义`@`密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆