Git http push via WebDAV - what if my username has "@" in it?

My web hosting provider allows me to access my web space through WebDAV, so I decided to create a git repository to see what was going on. Cloning the repository is read-only, since "git clone http://my.server.com/repo.git " just uses the standard HTTP transport.

Problems arise when I try to use WebDAV because my user ID is " user@my.server.com " and I have to use port 2077. That means I have to do something like

git config remote.origin.pushurl http:// user@my.server.com @my.server.com:2077/repo.git 

and the two @ signs in the URL should cause problems because "git push origin master" reports "error 22".

I tried to create a .netrc entry

 machine my.server.com login user@my.server.com password **** 

but that didn't seem to help.

I also tried replacing the first "@" with "%", "\ @" and "% 40", but none of them worked.

+4
source share
2 answers

The current version of git does not handle percent-unescaping in the username and password. Yesterday I posted a patch to fix this (at least for HTTP URLs) so that it could be fixed soon. With the patch, you should have access to WebDAV with:

git config remote.origin.pushurl http: // user% 40my.server.com@my.server.com : 2077 / repo.git

However, you may have another problem related to the problem with libcurl> 7.16 (see the note in "git help http-push") at the time of writing.

+5
source

If the URI used by WebDAV performs a Unified Resource Identifier (URI): general syntax ( rfc3986 ) should not be @ in userinfo

  authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) pct-encoded = "%" HEXDIG HEXDIG unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" reserved = gen-delims / sub-delims gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" 

So you only tried with http:// user@my.server.com :2077/repo.git ?

+1
source

All Articles