Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn clone --password pass gives “Unknown option: password”

Tags:

I want to clone a svn repository using git, with a username and password given on the command-line.

I can write:

svn checkout --username user --password pass svn://server/repo 

But I can't use --password with git svn clone:

git svn clone --username user --password pass svn://server/repo Unknown option: password 

How can I give the password to git svn clone on the command-line?

Alternatively, is there a kind of --svn-options switch to git-svn?

P.-S. Note that I need to specify it on the command-line, because there are multiple repos on this server with different user/pass, and svn stupidly assumes that all repos use the same username/password, so half of the time I get svn: Authorization failed, without it asking for the password, even if I use --username (it seems to ask for the password sometimes, but it's not robust enough to be used in a script).

like image 776
Suzanne Soy Avatar asked Jan 10 '14 09:01

Suzanne Soy


People also ask

How do I clone a Git repository in SVN?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...

Can you use SVN with GitHub?

GitHub repositories can be accessed from both Git and Subversion (SVN) clients. This article covers using a Subversion client on GitHub and some common problems that you might run into. GitHub supports Subversion clients via the HTTPS protocol. We use a Subversion bridge to communicate svn commands to GitHub.


2 Answers

git svn uses SVN commands directly and thus the internally saved password of SVN.

Run the command:

svn checkout --username user --password pass svn://server/repo 

and let SVN remember your password.

If this does not work remove the saved SVN authentications:

$HOME/.subversion/auth/svn.simple/* 

Then git svn clone will prompt you for the password.

like image 142
jolestar Avatar answered Sep 20 '22 13:09

jolestar


Just specify the username with --username and you should be prompted for a password.

See git svn --help or man git svn for further information.

like image 35
JohnK Avatar answered Sep 21 '22 13:09

JohnK