首页 > 解决方案 > 为 Git Bash 配置代理凭据,但面临特殊字符问题

问题描述

想为 Git Bash 设置代理凭据,但我的密码末尾包含特殊字符,例如我的密码是 1122!!@@

我试过 proxy = http://username:1122!!@@@proxy.com:8xxx 和 proxy = http://username:1122%21%21%40%40@proxy.com:8xxx也无法工作。

而不是更改密码,我怎么能发短信让 .gitconfig 读取它?

标签: gitproxyspecial-characters

解决方案


第二种形式(百分比编码)应该可以工作。

http.proxy正如评论的那样,正确的设置是。

另一种方法是,为了测试,在你的 git bash 会话中设置环境变量:

export HTTP_PROXY=http://username:1122%21%21%40%40@proxy.com:8xxx
export HTTPS_PROXY=http://username:1122%21%21%40%40@proxy.com:8xxx

并从您的 git 配置中删除任何代理条目:git config -l|grep -i proxy

如果可行,您可以将这些export指令添加到您的~/.bashrc.


推荐阅读