I was wondering if there is a way to save my Subversion password when doing svn operations from the console. The console is the only option that I have. When I try to do any Subversion action, e.g. svn commit, it prompts for the account password every time. Is there a way to save this password somehow so that I don't have to retype it every time?

8 Answers
8

In ~/.subversion/config, you probably have store-passwords = no. Change it to yes (or just comment it out because it defaults to yes), and the next time you give subversion your password it should save it. You might want to ensure that the owner and permissions of ~/.subversion/config are correct (no public or group access; 600).

@Seven Better yet, just write a new answer that's more up-to-date. (The store-passwords option in config is now deprecated, according to some default comments I found in my config file; it has been replaced by the same option in servers.)
–
Kyle StrandSep 9 '14 at 23:24

It depends on the protocol you're using. If you're using svn+ssh, the svn client can't save your password because it never touches it - the ssh client prompts you for it directly. In this case, you can use an ssh key and ssh-agent to avoid the constant prompts. If you're using the svnserve protocol or HTTP(S), then the svn client is handling your password and can save it.

+1 I have this exact problem - svn+ssh always, always asks me for a password. Outside of a sharing a public key, is there a way to avoid this? I have tried ssh-agent, but with no luck.
–
Michael MikowskiMar 7 '12 at 22:30

@MichaelMikowski Seems SSH password cannot be saved to config for automatic login. You can create a new key-pair for it, store the location of the private key to .ssh/config, append the public key to SVN server.
–
lk_vcOct 8 '14 at 12:49

Please note the following paragraph from the ~/.subversion/servers file :

Both 'store-passwords' and 'store-auth-creds' can now be
specified in the 'servers' file in your config directory.
Anything specified in this section is overridden by settings
specified in the 'servers' file.

at least for svn, version 1.6.12. So keep in mind to edit the servers file also as it overrides ~/.subversion/config

Using plaintext may not be the the best choice, if the password is ever used as something else.

I support the accepted answer, but it didn't work for me - for a very specific reason: I wanted to use either kwallet or gnome-keyring password stores. I tried changing the settings, all over the four files:

Even after it all was set the same, with password-stores and KWallet name (default might be wrong, right?) it didn't work, and kept asking for password forever. The files in ~/.subversion had permissions 600.

Well, at that point, you may try to check one simple thing:

which svn

if you get:

/usr/bin/local/svn

then you may suspect with great likelihood, that this client was built from source, locally, by your Admin (which may be yourself, as in my case).

Subversion is a nasty beast to compile, very easy to accidentally build without HTTP support, or - as in my example - without support for encrypted password stores (you need either Gnome or KDE development files, and a lot of them!). But the ./configure script won't tell you that, and you just get a less functional svn command.

In that case, you may go back to the client, which came with your distribution, usually in /usr/bin/svn. The downside is - you'll probably need to re-checkout the working copies, as there is no svn downgrade command. You can consult Linus Thorvalds on what to think about Subversion, anyway ;)