如何在.gitconfig代理身份验证中转义特殊字符

时间:2022-01-10 22:29:49

I'm trying to use git behind a proxy and i have set up the proxy details in the .gitconfig files as follows.

我尝试在代理后面使用git,并在.gitconfig文件中设置了如下所示的代理细节。

 [http]
     proxy = http://<username>:<password>@<proxy_ip>:<proxy_port>

The problem is that the username and password field contain the '@' character which needs to be escaped.How should it be escaped?

问题是用户名和密码字段包含需要转义的“@”字符。怎么才能逃脱呢?

1 个解决方案

#1


11  

Replacing @ with %40. (as illustrated, for instance, in this bug report)

取代@ % 40。(如本bug报告所示)

export http_proxy=http://username%40domain.com:password@host:port

#1


11  

Replacing @ with %40. (as illustrated, for instance, in this bug report)

取代@ % 40。(如本bug报告所示)

export http_proxy=http://username%40domain.com:password@host:port