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

I'd like to know how to get Subversion to change the name that my changes appear under.

I'm just starting to use Subversion. I'm currently using it to version control code on an XP laptop where I'm always logged in under my wife's name. I'd like the subversion DB to show the changes under my name.

Later on I'll replicate the DB so it is accessible to the whole house. My wife uses the office computer where she is always logged in under my name. I'll probably set it up so that it automatically checks in modified documents... preferably under her name.

Eventually I'll probably be using it from a linux machine under another username.

Is there some way to modify the user environment to change the user name that Subversion calls you? I'd expect something like setting SVN_USERNAME='Mark' which would override however it usually gets the name.

Update: It looks like the --username flag that Michael referred to does work to change the name reported by "svn stat", even for local file: repositories. In addition, it is sticky so you don't need to specify it for the next command. I even rebooted and it still used the "--username" value from my previous boot.

This question is related to authentication svn

The answer is


Using Subversion with either the Apache module or svnserve. I've been able to perform operations as multiple users using --username.

Each time you invoke a Subversion command as a 'new' user, your $HOME/.subversion/auth/<authentication-method>/ directory will have a new entry cached for that user (assuming you are able to authenticate with the correct password or authentication method for the server you are contacting as that particular user).


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.


Go to ~/.subversion/auth/svn.simple/*, and you will see a list of files that contains the information about your svn user account. Just delete all others that you don't need.

After that, when you do anything that regards to SVN operation, such as commit, rm, etc,. You will be prompt again to enter username or passwords.


TortoiseSVN always prompts for username. (unless you tell it not to)


If you are using svn+ssh to connect to the repository then the only thing that authenticates you and authorizes you is your ssh credentials. EVERYTHING else is ignored. Your username will be logged in subversion exactly as it is established in your ssh connection. An excellent explanation of this is at jimmyg.org/blog/2007/subversion-over-svnssh-on-debian.html


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.


I believe if you use the file:// method to access your subversion repository, your changes are always performed under the user which accesses the repository. You need to use a method that supports authentication such as http:// or svn://.

See http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing


TortoiseSVN always prompts for username. (unless you tell it not to)


I believe you can set the SVN_USER environment variable to change your SVN username.


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.


Using Subversion with either the Apache module or svnserve. I've been able to perform operations as multiple users using --username.

Each time you invoke a Subversion command as a 'new' user, your $HOME/.subversion/auth/<authentication-method>/ directory will have a new entry cached for that user (assuming you are able to authenticate with the correct password or authentication method for the server you are contacting as that particular user).


I believe you can set the SVN_USER environment variable to change your SVN username.


If you are using svn+ssh to connect to the repository then the only thing that authenticates you and authorizes you is your ssh credentials. EVERYTHING else is ignored. Your username will be logged in subversion exactly as it is established in your ssh connection. An excellent explanation of this is at jimmyg.org/blog/2007/subversion-over-svnssh-on-debian.html


Most of the answers seem to be for svn+ssh, or don't seem to work for us.

For http access, the easiest way to log out an SVN user from the command line is:

rm ~/.subversion/auth/svn.simple/*

Hat tip: http://www.yolinux.com/TUTORIALS/Subversion.html


Go to ~/.subversion/auth/svn.simple/*, and you will see a list of files that contains the information about your svn user account. Just delete all others that you don't need.

After that, when you do anything that regards to SVN operation, such as commit, rm, etc,. You will be prompt again to enter username or passwords.


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

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


TortoiseSVN always prompts for username. (unless you tell it not to)


Most of the answers seem to be for svn+ssh, or don't seem to work for us.

For http access, the easiest way to log out an SVN user from the command line is:

rm ~/.subversion/auth/svn.simple/*

Hat tip: http://www.yolinux.com/TUTORIALS/Subversion.html


I believe if you use the file:// method to access your subversion repository, your changes are always performed under the user which accesses the repository. You need to use a method that supports authentication such as http:// or svn://.

See http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing


I believe if you use the file:// method to access your subversion repository, your changes are always performed under the user which accesses the repository. You need to use a method that supports authentication such as http:// or svn://.

See http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing


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.


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.


I believe if you use the file:// method to access your subversion repository, your changes are always performed under the user which accesses the repository. You need to use a method that supports authentication such as http:// or svn://.

See http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing


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!]).


Using Subversion with either the Apache module or svnserve. I've been able to perform operations as multiple users using --username.

Each time you invoke a Subversion command as a 'new' user, your $HOME/.subversion/auth/<authentication-method>/ directory will have a new entry cached for that user (assuming you are able to authenticate with the correct password or authentication method for the server you are contacting as that particular user).


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!]).


Using Subversion with either the Apache module or svnserve. I've been able to perform operations as multiple users using --username.

Each time you invoke a Subversion command as a 'new' user, your $HOME/.subversion/auth/<authentication-method>/ directory will have a new entry cached for that user (assuming you are able to authenticate with the correct password or authentication method for the server you are contacting as that particular user).


I believe you can set the SVN_USER environment variable to change your SVN username.


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

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