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).
# 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 ...
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.
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.
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.
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