I run into a problem with command line git on Linux.

The remote git server I try to clone from uses HTTPS as a protocol and
requires full
fledged e-mail addresses for a user name in its authentication. In
TortoiseGit (with
winstore) or SourceTree, the user name and password are asked and
stored. But on the
command line I'm stuck, unable to provide the user name.

Here is what happens. First try cloning without specifying the user name:

$ git clone https://git.server.com/git/test.git
Initialized empty Git repository in /tmp/git/test/.git/
error: The requested URL returned error: 401 Authorization Required
while accessing

fatal: HTTP request failed

I couldn't find a "--username" flag or something similar for the git
command, so my next
try was to incorporate the user name in the URL, basic auth style. The
repo URL looks
something like this:


Note the double "@" there, it is bound to cause trouble.
This is what happened:

$ git clone https://user.em...@emaildomain.com@git.server.com/git/test.git
Initialized empty Git repository in /tmp/git/test/.git/
error: Couldn't resolve host 'emaildomain....@git.server.com' while accessing

fatal: HTTP request failed

It appears the "@" was picked up as an indication that the URL
contains the username,
however the URL was split at the wrong position. The splitting
algorithm doesn't seem to
take into account that a user name might contain an "@".

My request: please modify command line git to support full fledged
e-mail addresses as
user names in HTTPS requests.

I'm not a C adept, still I browsed the code a bit and bumped into
"transport_anonymize_url" method. I think that code could be modified
to do a better job
of splitting the URL, which might then avoid problems down the line.

Thanks for reading this far.


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to