[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Configure user name?

From: Tobias Bading <tbading_at_web.de>
Date: Sat, 19 Apr 2014 18:04:57 +0200

On 19.04.2014, at 13:44, Zé wrote:
> On 04/18/2014 04:41 PM, Bob Archer wrote:
>>> Does subversion provide a way for the user to configure his username, thus
>>> avoiding having to pass the --username flag everytime he has to commit
>>> something?
>>>
>>> Thanks
>>> Zé
>>
>> The credentials should be cached. If they are not being cached check 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.
>
> My question was if Subversion provided a way to configure the username. It appears that by default subversion forces the user to use his system username, and it also provides a way to specify a custom username through the --username option, but it appears there is no way to let a user configure a custom username.
>
> --
> Zé

Well, it depends on what you mean by "let a user configure a custom username". Would you like to configure a username per working copy or a username per repository? Subversion allows you to do the latter. So, if you would like Subversion to use a certain username for a certain repository (but not remember the password), the following settings in ~/.subversion/servers should do the trick:

[groups]
repo1 = domain-name-of-server

[repo1]
username = your-username
store-passwords = no

I've never tried the username setting myself, actually it's a bit strange that this option is not mentioned in the Subversion book. It is mentioned in the comments of ~/.subversion/servers (generated by a Subversion 1.8 client) though.
Anyway, in case the "username = your-username" part doesn't work, you can use

[repo1]
store-auth-creds = yes
store-passwords = no

instead. You'd have to use command line option --username once afterwards to make Subversion remember the username in its cache. You shouldn't have to mention the username again after that.

Happy Easter,
Tobias

PS: more details in
- http://svnbook.red-bean.com/nightly/en/svn.advanced.confarea.html#svn.advanced.confarea.opts.servers
- http://svnbook.red-bean.com/nightly/en/svn.serverconfig.netmodel.html#svn.serverconfig.netmodel.creds
- the comments in ~/.subversion/servers
Received on 2014-04-19 18:05:35 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.