Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Subversion can I be a user other than my login name?

People also ask

How do I add a user to svn?

svn Administering SVN Create new userSpecify user_name with the username you wish to add in above command. It will prompt to provide password for the user. If you are creating very first user, you need to add –c switch in above command, which will create the file.


Most Subversion commands take the --username option to specify the username you want to use to the repository. Subversion remembers the last repository username and password used in each working copy, which means, among other things, that if you use svn checkout --username myuser you never need to specify the username again.

As Kamil Kisiel says, when Subversion is accessing the repository directly off the file system (that is, the repository URL is of form file:///path/to/repo or file://file-server/path/to/repo), it uses your file system permissions to access the repository. And when you connect via SSH tunneling (svn+ssh://server/path/to/repo), SVN uses your FS permissions on the server, as determined by your SSH login. In those cases, svn checkout --username may not work for your repository.


For svn over ssh try:

svn list svn+ssh://[user_name]@server_name/path_to_repo  

svn will prompt you for the user_name's password.


You can setup a default username via ~/.subversion/servers:

[groups]
yourgroupname = svn.example.com

[yourgroupname]
username = yourusername

Please be aware that older versions of svn do not support it (e.g. 1.3.1 [sic!]).


"svn co --username=yourUserName --password=yourpassword http://path-to-your-svn"

Worked for me when on another user account. You will be prompted to enter username/password again though. You need to login like the above once and you are all set for the subsequent times(Unless you restart your machine).


If you need to specify a username other than your logged in user for use with svn+ssh just add an entry to your .ssh/config file:

Host example.com
User jdoe

Subversion usually asks me for my "Subversion username" if it fails using my logged in username. So, when I am lazy (usually) I'll just let it ask me for my password and I'll hit enter, and wait for the username prompt and use my Subversion username.

Otherwise, Michael's solution is a good way to specify the username right off.