I have git proxy config as 'http.proxy=http://userId:pwd@123@ipaddress:port' but while cloning a remote project, I'm getting error as
Cloning into git... error: Couldn't resolve proxy '123@ipaddress' while accessing http://git.kernel.org/pub/scm/git/git.git/info/refs fatal: HTTP request failed
How to escape the '@' character in password?
Pls note: I cannot change the password.
When you want one of those “special characters” to be literally printed, that's called character escaping. To escape a character, simply add a backslash ( \ ) before it.
You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
Setting the proxy for Gitgit config --global --add http. proxy http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT. git config --global --add https. proxy http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT.
One way to clone a repository without having to enter your password would be to create an app-password and use it while cloning. That done, git won't prompt for user name and password. Mind that this is a URL and needs to be encoded as an URL then. This will leave the password in the git configuration.
I'd try using the URL Encoded value of the @ symbol (%40
) if you're passing the password in the proxy url:
http.proxy=http://userId:pwd%40123@ipaddress:port
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With