Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn https authentication

The git-svn document says

--username= For transports that SVN handles authentication for (http, https, and plain svn), specify the username. For other transports (eg svn+ssh://), you must include the username in the URL, eg svn+ssh://[email protected]/project

However, in my computer (Windows 7,git version 1.9.4.msysgit.0), when I use

git svn clone https://server/svn/repo

It asks password for my windows user name first, and then (failed, since the server uses svn auth) ask the server user name and password. Everything works fine.

The problem happens when I try to clone another repo. Since this repo only available to another user, I use the following command.

git svn clone https://server/svn/repo1 --username xxx

I was expected it to ask for password but it didn't. It is simply failed with a 403 error.

I also tried to clone a third repo that available to both users, but I wanted to specify the user to be the later one,

git svn clone https://server/svn/repo2 --username xxx

It success without any password prompt. Since the passwords are different it must use the previous user credential.

Later I recognized that I shall use

git svn clone https://server/svn/repo2 --username=xxx

But it is still the same thing.

So it looks like --username=xxx didn't do anything. How to resolve this issue?

like image 558
Earth Engine Avatar asked Sep 03 '14 03:09

Earth Engine


1 Answers

Thanks for Sergey's prompt. It actually works after I cleared the subversion credential cache (%HOMEPATH%\.subversion\auth\svn.simple).

However I don't know why it was designed this way -- I would expect an explicit "--username" parameter shall override any thing in the credential cache. Maybe this is just a bug?

like image 123
Earth Engine Avatar answered Sep 30 '22 23:09

Earth Engine